|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectheurgame.event.TurnDispatcher
Field Summary | |
protected int |
currentTurn
|
protected java.util.Vector |
mylisteners
|
protected java.util.Vector |
normalLog
|
protected int |
totalTurns
|
protected int |
turnsInRound
|
protected java.util.Vector |
urgentLog
|
Constructor Summary | |
TurnDispatcher(int total,
int current,
int turnsRound)
Creates a new TurnDispatcher. |
Method Summary | |
void |
addTurnListener(TurnListener t)
Adds a Turn Listener to be notified of changes |
void |
changeTurn()
Notifies all listeners that a new turn has started. |
java.util.List |
getEntries()
This is the normal method for adding information to the log. |
java.lang.String |
getLogName()
Usually a particular LogWriter is going to send more than one message to the log during the life of a program. |
protected void |
logTurnState(java.lang.String shortMessage)
|
void |
removeAllTurnListeners()
|
void |
removeTurnListener(TurnListener t)
Removes a Turn Listener |
void |
setTotalTurns(int total)
|
void |
setTurn(int nextCurrentTurn)
|
void |
setTurnsInRound(int turnsPerRound)
|
java.util.List |
urgentEntries()
Normally logs are stored in a FIFO manner. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector mylisteners
protected java.util.Vector normalLog
protected java.util.Vector urgentLog
protected int totalTurns
protected int currentTurn
protected int turnsInRound
Constructor Detail |
public TurnDispatcher(int total, int current, int turnsRound)
total
- Total Number of Turnscurrent
- The Current TurnturnsRound
- The Number of Turns Per Round.
If you have five players and want to give each player three turns
in the game then you should make sure you set the Turns Per Round to
to Five and the Total Number of Turns to Fiftreen.Method Detail |
public void addTurnListener(TurnListener t)
t
- to be addedpublic void removeTurnListener(TurnListener t)
t
- to be removedpublic void removeAllTurnListeners()
public void setTurn(int nextCurrentTurn)
nextCurrentTurn
- Should be a positive number.public void setTurnsInRound(int turnsPerRound)
public void setTotalTurns(int total)
total
- New total number of turns.public void changeTurn()
protected void logTurnState(java.lang.String shortMessage)
shortMessage
- to Accompany the log entrypublic java.lang.String getLogName()
LogWriter
getLogName
in interface LogWriter
LogWriter.getLogName()
public java.util.List getEntries()
LogWriter
getEntries
in interface LogWriter
LogWriter.getEntries()
public java.util.List urgentEntries()
LogWriter
urgentEntries
in interface LogWriter
LogWriter.urgentEntries()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |