package electrosphere.game.server.character;

import electrosphere.game.server.character.diety.Diety;
import electrosphere.game.server.race.model.Race;
import electrosphere.game.server.structure.virtual.Structure;
import electrosphere.game.server.town.Town;
import org.joml.Vector2i;

/**
 * Utility functions for dealing with characters
 */
public class CharacterUtils {
    
    public static void addDiscretePosition(Character character, int posX, int posY){
        character.putData(CharacterDataStrings.POSITION_DISCRETE, new Vector2i(posX,posY));
    }
    
    public static Vector2i getDiscretePosition(Character character){
        return (Vector2i)character.getData(CharacterDataStrings.POSITION_DISCRETE);
    }
    
    public static void addDiety(Character character, Diety diety){
        character.putData(CharacterDataStrings.DIETY, diety);
    }
    
    public static Diety getDiety(Character character){
        return (Diety)character.getData(CharacterDataStrings.DIETY);
    }
    
    public static void addRace(Character character, Race race){
        character.putData(CharacterDataStrings.RACE, race);
    }
    
    public static Race getRace(Character character){
        return (Race)character.getData(CharacterDataStrings.RACE);
    }
    
    public static void addShelter(Character character, Structure shelter){
        character.putData(CharacterDataStrings.SHELTER, shelter);
    }
    
    public static Structure getShelter(Character character){
        return (Structure)character.getData(CharacterDataStrings.SHELTER);
    }
    
    public static void addHometown(Character character, Town town){
        character.putData(CharacterDataStrings.HOMETOWN, town);
    }
    
    public static Town getHometown(Character character){
        return (Town)character.getData(CharacterDataStrings.HOMETOWN);
    }
    
}
