package org.studiorailgun.sim.character.gen;

import org.studiorailgun.sim.character.Character;
import org.studiorailgun.sim.character.emotion.EmotionData;
import org.studiorailgun.sim.character.needs.NeedsHierarchy;
import org.studiorailgun.sim.character.vis.CharacterAppearance;

/**
 * Generates a character
 */
public class CharacterGenerator {
    
    /**
     * Generates a character
     * @return The character
     */
    public static Character generateCharacter(){
        Character rVal = new Character();

        CharacterGenerator.generateAppearance(rVal);
        CharacterGenerator.generateEmotions(rVal);
        CharacterGenerator.generateNeedsHierarchy(rVal);

        rVal.setLocationId(Character.LOCATION_UNASSIGNED);


        return rVal;
    }

    /**
     * Generates the appearance data for the character
     * @param character The character
     */
    private static void generateAppearance(Character character){
        CharacterAppearance appearance = new CharacterAppearance();
        appearance.setParent(character);

        appearance.setRace("human");

        character.setAppearance(appearance);
    }

    /**
     * Generates the emotion data for the character
     * @param character The character
     */
    private static void generateEmotions(Character character){
        EmotionData emotions = new EmotionData();
        character.setEmotions(emotions);
    }

    /**
     * Generates the needs data for the character
     * @param character The character
     */
    private static void generateNeedsHierarchy(Character character){
        NeedsHierarchy needs = new NeedsHierarchy();
        character.setNeeds(needs);
    }

}
