|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.thestump.ghronos.mediate.Registrar net.thestump.ghronos.mediate.Mediator
Mediates communication between the program's various objects. Follows the mediator design pattern. Is a singleton class.
Field Summary |
Fields inherited from class net.thestump.ghronos.mediate.Registrar |
bottomClock, hardButton, mainWin, menuBar, stateLabel, timingStyle, topClock |
Method Summary | |
void |
endGame()
Adjusts the interface to reflect the end of a game |
boolean |
gameIsOver()
Tells if the game is over or not |
byte |
getID()
|
superwaba.ext.xplat.io.Storable |
getInstance()
|
int |
getMoves()
Gets the total number of moves made during a game |
static Mediator |
instance()
Singleton getter |
boolean |
isPaused()
Tells if the game is paused or not |
boolean |
isTicking(char clock)
Tells the ticking status of a clock |
void |
loadState(superwaba.ext.xplat.io.DataStream ds)
|
void |
outOfTime(Clock clock)
Tells the mediator that a clock is out of time |
void |
replaceClock(Clock toReplace,
Clock replacement)
Replaces a clock on the main interface. |
void |
replaceState(StateLabel replacement)
Replaces a state label on the main interface. |
void |
reset(boolean toStart)
Resets the interface to game start |
void |
reversePauseState()
If the game is currently paused, this unpauses the interface. |
void |
saveState(superwaba.ext.xplat.io.DataStream ds)
|
void |
switchClocks()
Controls switching the clocks between players |
Methods inherited from class net.thestump.ghronos.mediate.Registrar |
getTimingStyle, registerClocks, registerHardButton, registerMainWindow, registerMenubar, registerState, registerTimingStyle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Mediator instance()
public int getMoves()
public boolean gameIsOver()
public boolean isPaused()
public void outOfTime(Clock clock)
clock
- The clock that is out of timepublic boolean isTicking(char clock)
clock
- 't' if we want to test the ticking status of the top clock.
'b' if we want to test the ticking status of the bottom clock
BadArgumentException
- If clock
is not 't' or 'b'public void replaceState(StateLabel replacement)
replacement
- The new StateLabelpublic void endGame()
public void reversePauseState()
public void replaceClock(Clock toReplace, Clock replacement)
toReplace
- One of the clocks from the MainWindow
that we want to replacereplacement
- The clock to replace toReplace withpublic void switchClocks()
public void reset(boolean toStart)
toStart
- true if we want to reset the game time to the last
time set. False to zero out the clockspublic byte getID()
getID
in interface superwaba.ext.xplat.io.Storable
public superwaba.ext.xplat.io.Storable getInstance()
getInstance
in interface superwaba.ext.xplat.io.Storable
public void saveState(superwaba.ext.xplat.io.DataStream ds)
saveState
in interface superwaba.ext.xplat.io.Storable
public void loadState(superwaba.ext.xplat.io.DataStream ds)
loadState
in interface superwaba.ext.xplat.io.Storable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |