morey.spore
Class Claim
java.lang.Object
|
+--morey.spore.SporeAction
|
+--morey.spore.Claim
- public class Claim
- extends SporeAction
- implements java.lang.Cloneable
claim the area under the spore. The result is the spore doesn't
to move -- only a claim is attempted. The legitimacy of the claim is
computed by the cpu. A failed claim causes the death of the spore.
The execution time is related to the area the spore covers
(scale against a rotation Left or Right).
The complexity of this SporeAction is moderate (scale against a rotation Left
or Right).
Here
is a link to the source code
- See Also:
Left,
Right,
Type,
Flip,
Spawn
|
Constructor Summary |
Claim()
construct a simple claim. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
EXECUTE
protected static final double EXECUTE
COMPLEXITY
protected static final int COMPLEXITY
Claim
public Claim()
- construct a simple claim.
getExecutionTime
public double getExecutionTime(Spore s,
Processor cpu)
- gets up the time of execution for the next action
- Overrides:
- getExecutionTime in class SporeAction
- Parameters:
s - the spore wanting to execute the actioncpu - that executes this action (and required info...)- Returns:
- the time of execution
executeAction
public boolean executeAction(Spore s,
Processor cpu)
- claims the area under the spore
- Overrides:
- executeAction in class SporeAction
- Returns:
- true if the claim suceeds
toString
public java.lang.String toString()
- Gives a String representation of this
- Overrides:
- toString in class java.lang.Object