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

Field Summary
protected static int COMPLEXITY
           
protected static double EXECUTE
           
 
Fields inherited from class morey.spore.SporeAction
NO_COMPLEXITY
 
Constructor Summary
Claim()
          construct a simple claim.
 
Method Summary
 boolean executeAction(Spore s, Processor cpu)
          claims the area under the spore
 double getExecutionTime(Spore s, Processor cpu)
          gets up the time of execution for the next action
 java.lang.String toString()
          Gives a String representation of this
 
Methods inherited from class morey.spore.SporeAction
addSpore, addSporeCommands, parseCommand, parseSpore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXECUTE

protected static final double EXECUTE

COMPLEXITY

protected static final int COMPLEXITY
Constructor Detail

Claim

public Claim()
construct a simple claim.
Method Detail

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 action
cpu - 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