Esempio n. 1
0
        public FinalCell(TissueCell parentCell)
            : base(parentCell)
        {
            initializeFinalCell();
            //if (parentCell.GetType() == typeof(BlastCell))
            //{
            //    this.generation = 1;
            //    if (SimulationCore.DEBUG)
            //    {
            //        if (parentCell.CellBehaviors.GetType() == typeof(GOBehaviorAggregate))
            //            throw new NotImplementedException("have not implemented GO behaviors yet");
            //    }

            //    //cellBehaviors = new SimpleBehaviorAggregate(SimulationCore.Instance.SimulationParams.FinalCellConfig);
            //}

            cellBehaviors = new SimpleBehaviorAggregate((SimpleBehaviorAggregate)parentCell.CellBehaviors);
            if (parentCell.GetType() == typeof(FinalCell))
                this.generation = ((FinalCell)parentCell).generation + 1;

            //cellBehaviors = new SimpleBehaviorAggregate((SimpleBehaviorAggregate)parentCell.CellBehaviors);
            /*
            else if (parentCell.GetType() == typeof(FinalCell))
            {
                this.generation = ((FinalCell)parentCell).generation + 1;
                cellBehaviors = new SimpleBehaviorAggregate((SimpleBehaviorAggregate)parentCell.CellBehaviors);
            }
             * */
        }
Esempio n. 2
0
        public void DeleteCell(TissueCell deadCell)
        {
            dyingCells.Add(deadCell);

            if (deadCell.Mutated)
                MutatedCellTotal--;

            // for the cell count
            if (deadCell.GetType() == typeof(FinalCell))
                Environment.Instance.FinalCellTotal--;
            else if (deadCell.GetType() == typeof(BlastCell))
                Environment.Instance.BlastCellTotal--;
            else
                throw new Exception("unsupported cell type");
        }
Esempio n. 3
0
        public void AddNewCell(TissueCell newCell)
        {
            newCells.Add(newCell);

            if (newCell.Mutated)
                MutatedCellTotal++;

            // for the cell count
            if (newCell.GetType() == typeof(FinalCell))
                FinalCellTotal++;
            else if (newCell.GetType() == typeof(BlastCell))
                BlastCellTotal++;
            else
                throw new Exception("unsupported cell type");
        }