java.lang.Object
marauroa.game.RPScheduler
- public class RPScheduler
- extends java.lang.Object
This class represent a scheduler to deliver action by turns, so every action
added to the scheduler is executed on the next turn.
Each object can cast as many actions as it wants.
|
Method Summary |
void |
addRPAction(RPAction action)
Add an RPAction to the scheduler for the next turn |
void |
nextTurn()
This method change the turn and delete all the actions in the actual turn |
void |
visit(RPRuleProcessor ruleProcessor)
For each action in the actual turn, make it to be run in the ruleProcessor
Depending on the result the action needs to be added for next turn. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
actualTurn
private java.util.HashMap actualTurn
- a HashMap of entries for this turn
nextTurn
private java.util.HashMap nextTurn
- a HashMap of entries for next turn
turn
private int turn
- Turn we are executing now
RPScheduler
public RPScheduler()
- Constructor
addRPAction
public void addRPAction(RPAction action)
throws RPScheduler.ActionInvalidException
- Add an RPAction to the scheduler for the next turn
visit
public void visit(RPRuleProcessor ruleProcessor)
- For each action in the actual turn, make it to be run in the ruleProcessor
Depending on the result the action needs to be added for next turn.
nextTurn
public void nextTurn()
- This method change the turn and delete all the actions in the actual turn