Terrarium.Game.GameEngine.countOrganism C# (CSharp) Method

countOrganism() private method

Adds another organism to the count of organisms. Depending on the organism type either plants or animals will be incremented.
private countOrganism ( OrganismState state, PopulationChangeReason reason ) : void
state OrganismState The state of the creature.
reason PopulationChangeReason The reason the creature is being added.
return void
        private void countOrganism(OrganismState state, PopulationChangeReason reason)
        {
            Debug.Assert(state != null);

            _populationData.CountOrganism(((Species) state.Species).Name, reason);
            if (state is AnimalState)
            {
                _animalCount++;
            }
            else
            {
                _plantCount++;
            }
        }