universum.bi
Enum EventKind

java.lang.Object
  extended by java.lang.Enum<EventKind>
      extended by universum.bi.EventKind
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<EventKind>

public enum EventKind
extends java.lang.Enum<EventKind>

Kind of an event. Actually encodes both events and actions, actions can be taken by being, and returned by makeTurn(), and events come to being's processEvent().

See Also:
BeingInterface, Being

Enum Constant Summary
ACTION_ATTACK
          Attack another creature, parameter is id of creature to be attacked.
ACTION_BORN
          Give birth to another creature, parameter is BeingParams of creature it wishes to give birth to, and it must not vary to much from being's own parameters.
ACTION_EAT
          Consume energy from the outside world.
ACTION_GIVE
          Give energy to another creature, it must also belong to you and be on the same cell.
ACTION_MOVE_ATTACK
          Attack another creature and move to the place where it is.
ACTION_MOVE_TO
          Move to particular location, parameter is location where being wishes to move.
ACTION_PRODUCE
          Produce a non-living entity.
BEING_ATTACKED
          Event received when other being attacks us, has amount of damage inflicted as parameter, and sender() is id of being who did this damage to us.
BEING_BORN
          Very first event being receives, as parameters contains BeingParams of this being passed by parent (can include arbirary parameter).
BEING_DEAD
          Very last event being receives, notifies about its death, has no paramters.
BEING_ENERGY_GIVEN
          Event received when got energy from other beings, parameter is amount of energy given (only your creatures can heal each another).
BEING_PRODUCED
          Notification on entity production.
UNKNOWN
          Unknown event
 
Method Summary
static EventKind valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static EventKind[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNKNOWN

public static final EventKind UNKNOWN
Unknown event


BEING_BORN

public static final EventKind BEING_BORN
Very first event being receives, as parameters contains BeingParams of this being passed by parent (can include arbirary parameter).

See Also:
ACTION_BORN

BEING_PRODUCED

public static final EventKind BEING_PRODUCED
Notification on entity production. Parameter is id of the produced entity. For contest there's no avaliable entitites, so it's only for future engine development.

See Also:
ACTION_PRODUCE

BEING_DEAD

public static final EventKind BEING_DEAD
Very last event being receives, notifies about its death, has no paramters.


BEING_ATTACKED

public static final EventKind BEING_ATTACKED
Event received when other being attacks us, has amount of damage inflicted as parameter, and sender() is id of being who did this damage to us.

See Also:
ACTION_ATTACK

BEING_ENERGY_GIVEN

public static final EventKind BEING_ENERGY_GIVEN
Event received when got energy from other beings, parameter is amount of energy given (only your creatures can heal each another).

See Also:
ACTION_GIVE

ACTION_MOVE_TO

public static final EventKind ACTION_MOVE_TO
Move to particular location, parameter is location where being wishes to move. Note that speed limits reachable locations.

See Also:
BeingInterface.getReachableLocations(Being), Constants.K_movecost

ACTION_BORN

public static final EventKind ACTION_BORN
Give birth to another creature, parameter is BeingParams of creature it wishes to give birth to, and it must not vary to much from being's own parameters. Energy is split in half between parent and baby.

See Also:
Constants.K_borncost, Constants.K_minbornvariation, Constants.K_maxbornvariation, BEING_BORN

ACTION_PRODUCE

public static final EventKind ACTION_PRODUCE
Produce a non-living entity. Parameter is string ID of entity to be produced. For contest there's no avaliable entitites, so it's only for future engine development.

See Also:
BEING_PRODUCED

ACTION_ATTACK

public static final EventKind ACTION_ATTACK
Attack another creature, parameter is id of creature to be attacked. Attacked creature must be at the same location as attacker.

See Also:
Constants.K_fight, Constants.K_retaliate, BEING_ATTACKED

ACTION_MOVE_ATTACK

public static final EventKind ACTION_MOVE_ATTACK
Attack another creature and move to the place where it is. Paramter is id of attacked creature. Attacked creature must be reachable for attacker (distance less than speed of attacker), and it does less damage than ACTION_ATTACK

See Also:
Constants.K_fight, Constants.K_retaliate, Constants.K_fightmovepenalty, BEING_ATTACKED

ACTION_EAT

public static final EventKind ACTION_EAT
Consume energy from the outside world. Amount of energy consumed per single turn is limited by creature parameters and available energy. Parameter is amount of energy to be consumed.

See Also:
Constants.K_bite, BeingInterface

ACTION_GIVE

public static final EventKind ACTION_GIVE
Give energy to another creature, it must also belong to you and be on the same cell. Paramter is id of the target being.

See Also:
BEING_ENERGY_GIVEN
Method Detail

values

public static EventKind[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (EventKind c : EventKind.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static EventKind valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null