Modifier and Type | Field and Description |
---|---|
protected Node |
currentNode |
protected int |
maxSteps |
Constructor and Description |
---|
Message(int maxSteps,
Node node)
Creates a message.
|
Modifier and Type | Method and Description |
---|---|
void |
die()
Sets the node to dead.
|
boolean |
isAlive()
Returns wether the node is alive or not.
|
abstract boolean |
move()
Moves the message.
|
abstract void |
update(Node n)
Sets the message handle for the current object.
|
protected int maxSteps
protected Node currentNode
public Message(int maxSteps, Node node) throws java.lang.IllegalArgumentException
maxSteps
- maximum amount of steps for message.java.lang.IllegalArgumentException
- if the input is invalid.public abstract boolean move()
public abstract void update(Node n)
public void die()
public boolean isAlive()