Ejemplo n.º 1
0
        //chem reactions
        private void Fuse(Nutrient head, Nutrient tail)
        {
            head.Decrease();
            tail.Decrease();
            Nutrient newNutrient = new Nutrient(head.molecule + tail.molecule, 1);

            Add(newNutrient);
        }
Ejemplo n.º 2
0
        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);
        }