|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectheurgame.event.turn.AbstractTurnIterator
heurgame.event.turn.AbstractTokenBasedIterator
heurgame.event.turn.RoundRobinIterator
Field Summary | |
protected int |
currentRound
Round will start with 1 currentRound |
protected PlayerToken |
currentToken
handle to the current player currentToken |
protected java.util.Vector |
latestTokens
Buffer to store incomming tokens latestTokens
This buffer will be used at the end of the current round. |
protected java.util.ListIterator |
playerHelper
A ListIterator is doing the real dirty work playerHelper |
protected java.util.Vector |
playerTokens
The source of the order is playerTokens |
protected LogBox |
rrLog
Handle for easy debugging access rrLog |
protected int |
totalRounds
Only positive numbers for totalRounds |
Fields inherited from class heurgame.event.turn.AbstractTurnIterator |
mylisteners |
Constructor Summary | |
RoundRobinIterator()
|
Method Summary | |
PlayerToken |
getCurrentToken()
|
boolean |
hasMore()
|
protected void |
logState(java.lang.String shortMessage)
Helper method to simplify adding log entries |
void |
next()
Shifts state to the next turn, and broadcasts the turnChanged Event |
void |
setup(int totalRounds,
java.util.Vector pTokens)
Sets or Resets the state of the Iterator |
void |
updateActiveTokens(java.util.Vector newTokens)
When there is some change in the order of players or the actual number of the players themselves it would be good for the iterator to compensate. |
Methods inherited from class heurgame.event.turn.AbstractTurnIterator |
addTurnListener, notifyTurnListeners, removeAllTurnListeners, removeTurnListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected LogBox rrLog
rrLog
protected java.util.Vector playerTokens
playerTokens
protected volatile int currentRound
currentRound
protected volatile int totalRounds
totalRounds
protected java.util.ListIterator playerHelper
playerHelper
protected volatile PlayerToken currentToken
currentToken
protected java.util.Vector latestTokens
latestTokens
This buffer will be used at the end of the current round.
Constructor Detail |
public RoundRobinIterator()
Method Detail |
public void setup(int totalRounds, java.util.Vector pTokens)
totalRounds
- Positive integerpTokens
- A Vector of Player Tokens in the desired orderpublic void next()
next
in class AbstractTurnIterator
AbstractTurnIterator.next()
public boolean hasMore()
hasMore
in class AbstractTurnIterator
AbstractTurnIterator.hasMore()
public void updateActiveTokens(java.util.Vector newTokens)
newTokens
- The new order of the tokens for the next roundprotected void logState(java.lang.String shortMessage)
shortMessage
- Describes the turnpublic PlayerToken getCurrentToken()
TokenBased.getCurrentToken()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |