|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdarwin.domain.Operation
This class represents operations in a Darwin Program. It is an enumeration of all valid operations.
Field Summary | |
static Operation |
GO
Jump to a new address. |
static Operation |
HOP
Move forward if the space ahead is empty. |
static Operation |
IFEMPTY
If the square in front of this creature is empty, update the next address. |
static Operation |
IFENEMY
If the square in front of this creature is occupied by a creature of an enemy species, update the next address. |
static Operation |
IFRANDOM
Update the address half the time. |
static Operation |
IFSAME
If the square in front of this creature is occupied by a creature of the same species, update the next address. |
static Operation |
IFWALL
If the creature is facing the border of the world, update the next address. |
static Operation |
INFECT
Infect the creature immediately in front of this creature. |
static Operation |
LEFT
Turn left 90 degrees. |
static Operation |
RIGHT
Turn right 90 degrees. |
Method Summary | |
boolean |
equals(java.lang.Object aObject)
Override-prevention method. |
static Operation |
getOperation(java.lang.String aOperationName)
Find an Operation by its name. |
int |
hashCode()
Override-prevention method. |
java.lang.String |
toString()
Return a String representation of this Operation. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Operation GO
public static final Operation HOP
public static final Operation IFEMPTY
public static final Operation IFENEMY
public static final Operation IFRANDOM
public static final Operation IFSAME
public static final Operation IFWALL
public static final Operation INFECT
public static final Operation LEFT
public static final Operation RIGHT
Method Detail |
public static Operation getOperation(java.lang.String aOperationName)
aOperationName
- the name of the Operation. The name is case sensitive. E.g.
"go".
public final boolean equals(java.lang.Object aObject)
public final int hashCode()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |