Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

marauroa.game
Class RPScheduler  view RPScheduler download RPScheduler.java

java.lang.Object
  extended bymarauroa.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.


Nested Class Summary
(package private) static class RPScheduler.ActionInvalidException
           
 
Field Summary
private  java.util.HashMap actualTurn
          a HashMap of entries for this turn
private  java.util.HashMap nextTurn
          a HashMap of entries for next turn
private  int turn
          Turn we are executing now
 
Constructor Summary
RPScheduler()
          Constructor
 
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
 

Field Detail

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

Constructor Detail

RPScheduler

public RPScheduler()
Constructor

Method Detail

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