OrganismState Methods |
The OrganismState type exposes the following members.
Name | Description | |
---|---|---|
![]() | AddIncubationTick |
Add a single tick to the current incubation period. Called
by the game engine each tick after the creature starts reproducing.
Once the amount of ticks hits the limit for the amount of time
required to incubate a child, the creature is born, and incubation
is no longer required.
|
![]() | AddTickToAge |
Adds a single tick to the creature's current age. This is
also responsible for ticking down other counters like growth
and reproduction. When ticks hits the LifeSpan the creature
dies, but when the other counters reach 0 the action becomes
available.
|
![]() | BurnEnergy |
Used by the game engine to burn a creature's energy depending
on the various actions they perform including movement, reproduction,
and growth.
|
![]() | CloneMutable |
Derived classes must override this to return an instance of their class type
that has the same state (by calling CopyStateInto)
|
![]() | CompareTo |
Compares two organism state objects together. This method takes into
account the Y position for graphical Z-Ordering purposes and can be used
to sort creatures for back to front rendering.
|
![]() | CopyStateInto |
Derived classes must override (and call Base.CopyStateInto)
if they have additional state
|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | Grow |
This returns a clone because we need the radius to be editable
and the object may not allow this because it is already in the index
the object returned will have the same events as the original
|
![]() | HealDamage |
Required override for other state classes. This method gives
the creature a chance to heal some previously inflicted damage.
|
![]() | IncreaseRadiusTo |
Used by the game engine to increase the radius of a creature to a new radius
amount. Each time a creature grows this method is called to set the new radius.
The new radius must be larger than the previous one, so creatures can't shrink.
The radius can be increased by more than a single unit, but the current
Terrarium only encompasses methods that increase a radius by a single unit.
|
![]() | IsAdjacentOrOverlapping | Determines if a creature is immediately next to or overlapping another creature using grid cells comparisons. |
![]() | IsWithinRect |
Used to compute whether or not a given state object is in an adjacent or
overlapping grid cell. The extra radius can be used to extend the area
used for the function to find a match and so can be used for functions
like visibiliy.
|
![]() | Kill |
Called by the game engine in order to kill the current creature.
Since this method can only be called when the state is mutable
player's can't use the method to arbitrarily kill competing
organisms.
|
![]() | LockSizeAndPosition |
Performs a special type of immutability lock for the size
and position related properties only. This is to ensure that
the area of a creature isn't changed after the creature's index
array position has been found in the game world.
|
![]() | MakeImmutable |
Makes all properties immutable. Ensures that the organism state
cannot be changed at all by creatures with access to the state.
|
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ResetGrowthWait |
Used by the game engine to reset the amount of time the creature
must wait before growing. The wait time is based on the creature's
species class which uses the creature's lifepsan as a base for the
growth period. This should be called after a creature has been
given the chance to grow, and must wait before growing again.
|
![]() | ResetReproductionWait |
Sets the current reproduction wait of the creature to
the wait time specified by the creature's species. This
value will be set based on the creature's lifespan and
creature type (whether carnivore or herbivore). This is
called by the engine after reproduction has completed.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() ![]() | UpperBoundaryForEnergyState | Returns the amount of energy required to be at the top of a given EnergyState. It's recommended that the actual EnergyState property be used to determine the current energy bucket a creature is in. |