Ejemplo n.º 1
0
        /// <summary>
        ///  Clones the current plant state while resetting the immutability attribute
        ///  so that the new state can be updated with new information.
        /// </summary>
        /// <returns>An newly mutable OrganismState that can be casted to a PlantState.</returns>
        /// <internal/>
        public override OrganismState CloneMutable()
        {
            var newInstance = new PlantState(ID, Species, Generation, EnergyState, Radius);

            CopyStateInto(newInstance);

            return(newInstance);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Clones the current plant state while resetting the immutability attribute
        ///  so that the new state can be updated with new information.
        /// </summary>
        /// <returns>An newly mutable OrganismState that can be casted to a PlantState.</returns>
        /// <internal/>
        public override OrganismState CloneMutable()
        {
            var newInstance = new PlantState(ID, Species, Generation, EnergyState, Radius);
            CopyStateInto(newInstance);

            return newInstance;
        }