예제 #1
0
파일: Stomac.cs 프로젝트: Horonex/EcoSim
        //chem reactions
        private void Fuse(Nutrient head, Nutrient tail)
        {
            head.Decrease();
            tail.Decrease();
            Nutrient newNutrient = new Nutrient(head.molecule + tail.molecule, 1);

            Add(newNutrient);
        }
예제 #2
0
파일: Stomac.cs 프로젝트: Horonex/EcoSim
        private void Split(Nutrient nutrient, string sString)
        {
            nutrient.Decrease();
            int cutIndex = Random.Range(0, nutrient.subStrings[sString].Count);

            Nutrient head = new Nutrient(nutrient.molecule.Substring(0, cutIndex), 1);
            Nutrient tail = new Nutrient(nutrient.molecule.Substring(cutIndex), 1);

            Add(head);
            Add(tail);
        }