コード例 #1
0
 public Embryo(Female mother, Male father) : base(mother, father)
 {
     subp      = UnityEngine.Random.Range(0, 1f);
     conceived = Planetarium.GetUniversalTime();
     birth     = CalcBirth();
     SetLocation(ProgenyScenario.current.GetLocation("Womb"));
 }
コード例 #2
0
        void LoadZygotes(ConfigNode config)
        {
            var zygote_list = config.nodes;

            foreach (ConfigNode z in zygote_list)
            {
                switch (z.name)
                {
                case "embryo":
                    var embryo = new Embryo(z);
                    embryos[embryo.id] = embryo;
                    break;

                case "juvenile":
                    var juvenile = new Juvenile(z);
                    juveniles[juvenile.id] = juvenile;
                    break;

                case "female":
                    var female = new Female(z);
                    females[female.id] = female;
                    break;

                case "male":
                    var male = new Male(z);
                    males[male.id] = male;
                    break;
                }
            }
        }
コード例 #3
0
 public Zygote(Female mother, Male father)
 {
     mother_id = mother.id;
     father_id = father.id;
     id        = ProgenyScenario.current.NextZygoteID();
     genes     = Genome.Combine(mother.genes, father.genes);
     init();
 }
コード例 #4
0
 public void Mature(Juvenile juvenile)
 {
     juveniles.Remove(juvenile.id);
     if (juvenile.isFemale)
     {
         var female = new Female(juvenile);
         females[female.id] = female;
     }
     else
     {
         var male = new Male(juvenile);
         males[male.id] = male;
     }
 }
コード例 #5
0
        public void AddKerbal(KerbalExt ext)
        {
            if (ProgenyScenario.current == null)
            {
                Debug.LogFormat("[ProgenyTracker] AddKerbal: delaying add");
                AddLoadingKerbal(ext);
                return;
            }
            Debug.LogFormat("[ProgenyTracker] AddKerbal: adding kerbal");
            Zygote kerbal;

            if (ext.kerbal.gender == ProtoCrewMember.Gender.Female)
            {
                kerbal = new Female(ext.kerbal);
            }
            else
            {
                kerbal = new Male(ext.kerbal);
            }
            kerbal_ids[ext.kerbal.name] = kerbal.id;
            ProgenyScenario.current.AddKerbal(kerbal);
            ext[name] = kerbal.id;
            CheckLocation(ext.kerbal);
        }
コード例 #6
0
ファイル: FemaleFSM.cs プロジェクト: taniwha/KerbalStats
 public FemaleFSM(Female female)
 {
     this.female = female;
     CreateStateMachine();
 }