nanomunchers
Class NanoGame

java.lang.Object
  extended bynanomunchers.NanoGame
All Implemented Interfaces:
heurgame.Game

public class NanoGame
extends java.lang.Object
implements heurgame.Game

A Centralized point for the Nanomunchers game. Highly tied to events.

Author:
David Kaplin

Constructor Summary
NanoGame()
           
 
Method Summary
 void announceDisqualification(heurgame.PlayerToken disqualified)
           
 void announcePlayerLeft(heurgame.PlayerToken gone)
           
 void announcePlayerStatus()
          Not used
 void buildHumanClient(java.lang.String name)
           
 heurgame.PlayerProxy buildPlayerProxy(heurgame.network.MemorySocketFacade connection)
           
 void endTurn()
          Not used
 java.lang.String getGreeting()
          WIDTH HEIGHT NUMBER_OF_MUNCHERS_PER_PLAYER
 heurgame.HuClient[] getHumanClients()
           
 java.lang.String getIncrementalState()
          Not used
 long getMaximumNormalTime()
           
 int getMaximumPlayers()
           
 long getMaximumWarningTime()
           
 int getMinimumPlayers()
           
 java.lang.String getName()
           
 java.lang.String getState()
          Reports more of the protocol when the game starts.
 heurgame.analysis.SystemAnalyzer getSystemAnalyzer()
           
 heurgame.event.TimeBroadcaster getTimeBroadcaster()
           
 void newGame(int munchers, Graph graph, boolean isComplete)
          Creates a new game with the following parameters:
 void playerAdded(heurgame.PlayerToken token)
          This is for the player listeners
 void reorderPlayers(heurgame.PlayerToken[] tokens)
           
 void setGameBroadcaster(heurgame.event.GameBroadcaster b)
           
 void setPlayerBroadcaster(heurgame.event.PlayerBroadcaster p)
           
 void setReferee(heurgame.Referee ref)
           
 void setTimeBroadcaster(heurgame.event.TimeBroadcaster t)
           
 void setupTime(long maximumNormal, long extra)
          Sets up the time constraints
 void setupUI(NanoSimulation ns, heurgame.ui.builder.ComponentOrientedBuilder cBuilder)
          Sets up the User interface
 void start()
          Runs the entire game.
 void terminate(java.lang.String arg0)
          Not needed
 boolean undoLastMove()
          Not used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NanoGame

public NanoGame()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface heurgame.Game
See Also:
Game.getName()

setupUI

public void setupUI(NanoSimulation ns,
                    heurgame.ui.builder.ComponentOrientedBuilder cBuilder)
Sets up the User interface

Parameters:
ns - needs to be tied to the SystemAnalyzer
cBuilder - for UI uniformity

setupTime

public void setupTime(long maximumNormal,
                      long extra)
Sets up the time constraints

Parameters:
maximumNormal - normal time
extra - warning time.

newGame

public void newGame(int munchers,
                    Graph graph,
                    boolean isComplete)
Creates a new game with the following parameters:

Parameters:
munchers - number of munchers per player
graph - data representing the board.
isComplete - true if this is a complete graph (less initial information needs to be communicated to the players if this is true)

getMinimumPlayers

public int getMinimumPlayers()
Specified by:
getMinimumPlayers in interface heurgame.Game
See Also:
Game.getMinimumPlayers()

getGreeting

public java.lang.String getGreeting()
WIDTH HEIGHT NUMBER_OF_MUNCHERS_PER_PLAYER

Specified by:
getGreeting in interface heurgame.Game
See Also:
Game.getGreeting()

getSystemAnalyzer

public heurgame.analysis.SystemAnalyzer getSystemAnalyzer()
Specified by:
getSystemAnalyzer in interface heurgame.Game
See Also:
Game.getSystemAnalyzer()

buildPlayerProxy

public heurgame.PlayerProxy buildPlayerProxy(heurgame.network.MemorySocketFacade connection)
Specified by:
buildPlayerProxy in interface heurgame.Game
See Also:
heurgame.Game#buildPlayerProxy(java.net.Socket)

buildHumanClient

public void buildHumanClient(java.lang.String name)
Specified by:
buildHumanClient in interface heurgame.Game
See Also:
Game.buildHumanClient(java.lang.String)

getHumanClients

public heurgame.HuClient[] getHumanClients()
Specified by:
getHumanClients in interface heurgame.Game
See Also:
Game.getHumanClients()

getState

public java.lang.String getState()
Reports more of the protocol when the game starts.

Specified by:
getState in interface heurgame.Game
See Also:
Game.getState()

getIncrementalState

public java.lang.String getIncrementalState()
Not used

Specified by:
getIncrementalState in interface heurgame.Game
See Also:
Game.getIncrementalState()

endTurn

public void endTurn()
Not used

Specified by:
endTurn in interface heurgame.Game
See Also:
Game.endTurn()

playerAdded

public void playerAdded(heurgame.PlayerToken token)
This is for the player listeners

Specified by:
playerAdded in interface heurgame.Game
See Also:
Game.playerAdded(heurgame.PlayerToken)

start

public void start()
Runs the entire game.

Specified by:
start in interface heurgame.Game
See Also:
Game.start()

undoLastMove

public boolean undoLastMove()
Not used

Specified by:
undoLastMove in interface heurgame.Game
See Also:
Game.undoLastMove()

announceDisqualification

public void announceDisqualification(heurgame.PlayerToken disqualified)
Specified by:
announceDisqualification in interface heurgame.Game
See Also:
Game.announceDisqualification(heurgame.PlayerToken)

announcePlayerLeft

public void announcePlayerLeft(heurgame.PlayerToken gone)
Specified by:
announcePlayerLeft in interface heurgame.Game
See Also:
Game.announcePlayerLeft(heurgame.PlayerToken)

announcePlayerStatus

public void announcePlayerStatus()
Not used

Specified by:
announcePlayerStatus in interface heurgame.Game
See Also:
Game.announcePlayerStatus()

reorderPlayers

public void reorderPlayers(heurgame.PlayerToken[] tokens)
Specified by:
reorderPlayers in interface heurgame.Game
See Also:
Game.reorderPlayers(heurgame.PlayerToken[])

setReferee

public void setReferee(heurgame.Referee ref)
Specified by:
setReferee in interface heurgame.Game
See Also:
Game.setReferee(heurgame.Referee)

getMaximumNormalTime

public long getMaximumNormalTime()
Specified by:
getMaximumNormalTime in interface heurgame.Game
See Also:
Game.getMaximumNormalTime()

getMaximumWarningTime

public long getMaximumWarningTime()
Specified by:
getMaximumWarningTime in interface heurgame.Game
See Also:
Game.getMaximumWarningTime()

getTimeBroadcaster

public heurgame.event.TimeBroadcaster getTimeBroadcaster()
Specified by:
getTimeBroadcaster in interface heurgame.Game
See Also:
Game.getTimeBroadcaster()

setGameBroadcaster

public void setGameBroadcaster(heurgame.event.GameBroadcaster b)
Specified by:
setGameBroadcaster in interface heurgame.Game
See Also:
Game.setGameBroadcaster(heurgame.event.GameBroadcaster)

setTimeBroadcaster

public void setTimeBroadcaster(heurgame.event.TimeBroadcaster t)
Specified by:
setTimeBroadcaster in interface heurgame.Game
See Also:
Game.setTimeBroadcaster(heurgame.event.TimeBroadcaster)

setPlayerBroadcaster

public void setPlayerBroadcaster(heurgame.event.PlayerBroadcaster p)
Specified by:
setPlayerBroadcaster in interface heurgame.Game
See Also:
Game.setPlayerBroadcaster(heurgame.event.PlayerBroadcaster)

getMaximumPlayers

public int getMaximumPlayers()
Specified by:
getMaximumPlayers in interface heurgame.Game
See Also:
Game.getMaximumPlayers()

terminate

public void terminate(java.lang.String arg0)
Not needed

Specified by:
terminate in interface heurgame.Game
See Also:
Game.terminate(java.lang.String)