public HumanGenetics(GameObject go, Human human, Human father, Human mother)
    {
        _go    = go;
        _human = human;
        HumanGenetics temp = BreedHumanGenetics(father._humanGenetics, mother._humanGenetics);

        _eyeColour  = temp._eyeColour;
        _hairColour = temp._hairColour;
        _skinTone   = temp._skinTone;
        ChooseClothes();
    }
Exemple #2
0
 public Human(GameObject go)
 {
     _go            = go;
     _age           = new TimeManager(_go, new TimeManager.YearMonth(Random.Range(0, 30), 0));
     _father        = null;
     _mother        = null;
     _humanSkills   = new HumanSkills(Random.Range(0, 8), go);
     _humanTraits   = new HumanTraits(_go, this);
     _humanGenetics = new HumanGenetics(_go, this);
     RandomizeNameAndGender();
 }
Exemple #3
0
 public Human(GameObject go, Human father, Human mother)
 {
     _go     = go;
     _age    = new TimeManager(_go);
     _father = father;
     _mother = mother;
     RandomizeNameAndGender(father, mother);
     _humanSkills   = new HumanSkills(Random.Range(0, 8), go);
     _humanTraits   = new HumanTraits(_go, this);
     _humanGenetics = new HumanGenetics(_go, this, _father, _mother);
 }
    HumanGenetics BreedHumanGenetics(HumanGenetics father, HumanGenetics mother)  //recursive breeding function
    {
        if (father._human._father != null)
        {
            father = BreedHumanGenetics(father._human._father._humanGenetics, father._human._mother._humanGenetics);
        }
        if (mother._human._mother != null)
        {
            mother = BreedHumanGenetics(mother._human._father._humanGenetics, mother._human._mother._humanGenetics);
        }
        HumanGenetics f      = father;
        HumanGenetics m      = mother;
        HumanGenetics result = new HumanGenetics
        {
            _eyeColour  = BreedEyeColour(f._eyeColour, m._eyeColour),
            _hairColour = BreedHairColour(f._hairColour, m._hairColour),
            _skinTone   = BreedSkinTone(f._skinTone, m._skinTone)
        };

        return(result);
    }
Exemple #5
0
    public Human(GameObject go, int template)
    {
        _go     = go;
        _father = null;
        _mother = null;
        switch (template)
        {
        case 0:
        {
            _age = new TimeManager(_go, new TimeManager.YearMonth(6, 0));
            //_ageZone = AgeZone.Child;
            _gender  = Gender.female;
            _name    = "Ava";
            _surname = "Shimmer";

            break;
        }

        case 1:
        {
            _age = new TimeManager(_go, new TimeManager.YearMonth(60, 0));
            //_ageZone = AgeZone.Elder;
            _gender   = Gender.female;
            _name     = "Nonna";
            _surname  = "Shimmer";
            _isVirgin = false;
            break;
        }

        case 2:
        {
            _age = new TimeManager(_go, new TimeManager.YearMonth(28, 0));
            //_ageZone = AgeZone.Adult;
            _gender      = Gender.male;
            _humanSkills = new HumanSkills(0, go);
            _name        = "Frase";
            _surname     = "Shimmer";
            _isVirgin    = false;
            break;
        }

        case 3:
        {
            _age = new TimeManager(_go, new TimeManager.YearMonth(21, 0));
            //_ageZone = AgeZone.Adult;
            _gender      = Gender.female;
            _humanSkills = new HumanSkills(2, go);
            _name        = "Dena";
            _surname     = "Flint";
            _isVirgin    = false;
            break;
        }

        case 4:
        {
            _age = new TimeManager(_go, new TimeManager.YearMonth(21, 0));
            //_ageZone = AgeZone.Adult;
            _gender      = Gender.male;
            _name        = "Heno";
            _surname     = "Pine";
            _humanSkills = new HumanSkills(Random.Range(0, 8), go);
            _isVirgin    = false;
            break;
        }
        }
        if (_humanSkills == null)
        {
            _humanSkills = new HumanSkills(template, go);
        }
        if (_humanGenetics == null)
        {
            _humanGenetics = new HumanGenetics(_go, this, template);
        }
        _humanTraits = new HumanTraits(_go, this);
    }