morey.spore
Class Repeater

java.lang.Object
  |
  +--morey.spore.SporeAction
        |
        +--morey.spore.Repeater

public class Repeater
extends SporeAction
implements java.lang.Cloneable

Repeater is not a true SporeAction -- it is a short form. For instance, "3 flip" is short for "flip flip flip". As well, sequence of actions can be repeated. For instance, "3 { flip claim }" is short for "flip claim flip claim flip claim".

Here is a link to the source code

See Also:
Sequence, Left, Type, Claim, Flip, Spawn

Field Summary
protected  int repetitions
          the number of times to repeat the next SporeAction
 
Fields inherited from class morey.spore.SporeAction
NO_COMPLEXITY
 
Constructor Summary
Repeater(int repetitions)
          construct a repeater
 
Method Summary
 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, executeAction, parseCommand, parseSpore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

repetitions

protected final int repetitions
the number of times to repeat the next SporeAction
Constructor Detail

Repeater

public Repeater(int repetitions)
construct a repeater
Method Detail

getExecutionTime

public double getExecutionTime(Spore s,
                               Processor cpu)
gets up the time of execution for the next action. This method will be simplified when I tweak the parser.
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

toString

public java.lang.String toString()
Gives a String representation of this
Overrides:
toString in class java.lang.Object