Terrarium.Game.WorldState.RemoveOrganism C# (CSharp) Method

RemoveOrganism() public method

Should only be called by the game engine. Removes an organism from the world state.
public RemoveOrganism ( string organismID ) : void
organismID string The ID of the organism that needs to be removed.
return void
        public void RemoveOrganism(string organismID)
        {
            if (IsImmutable)
            {
                throw new ApplicationException("WorldState must be mutable to change.");
            }

            // Clear the index if it's built
            if (IndexBuilt)
            {
                var state = GetOrganismState(organismID);
                FillCells(state, state.GridX, state.GridY, state.CellRadius, true);
            }

            _organisms.Remove(organismID);
        }