PlantState Methods |
The PlantState 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.
(Inherited from OrganismState.) |
![]() | 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.
(Inherited from OrganismState.) |
![]() | BurnEnergy |
Used by the game engine to burn a creature's energy depending
on the various actions they perform including movement, reproduction,
and growth.
(Inherited from OrganismState.) |
![]() | CloneMutable |
Clones the current plant state while resetting the immutability attribute
so that the new state can be updated with new information.
(Overrides OrganismStateCloneMutable.) |
![]() | 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.
(Inherited from OrganismState.) |
![]() | Equals | (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.) |
![]() | GiveEnergy |
The amount of energy a plant gets decreases linearly as you get away from the optimal
|
![]() | Grow |
Used by the game engine in order to grow a creature. This attempts
to grow the creature's radius by one unit. It makes a copy of the
organism state rather than modifying it directly since the size and
location properties might be immutable.
(Overrides OrganismStateGrow.) |
![]() | HealDamage |
Plants heal just by getting their foodchunks back up to the maximum level -- kind of
like growing their old leaves back. This should only be called by the game engine
and so the method is protected by the immutable property.
(Overrides OrganismStateHealDamage.) |
![]() | IncreaseRadiusTo |
Increases the radius of the creature to a new radius. The game
engine calls this whenever a plant grows. Since plants have
other attributes that change the base implementation of this
method must be overriden to also update the foodChunks property.
(Overrides OrganismStateIncreaseRadiusTo(Int32).) |
![]() | 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.
(Inherited from OrganismState.) |
![]() | 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.
(Inherited from OrganismState.) |
![]() | 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.
(Inherited from OrganismState.) |
![]() | MakeImmutable |
Makes all properties immutable. Ensures that the organism state
cannot be changed at all by creatures with access to the state.
(Inherited from OrganismState.) |
![]() | 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.
(Inherited from OrganismState.) |
![]() | 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.
(Inherited from OrganismState.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |