java.lang.Object
org.zazof.jteg.GameController
- All Implemented Interfaces:
- java.util.EventListener, MessageListener
- public class GameController
- extends java.lang.Object
- implements MessageListener
responsible for the general control of the game
|
Constructor Summary |
private |
GameController()
private constructor because this class is a singleton |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
$playerMode
private int $playerMode
- o = observer, 1 = player
$clientPlayer
private int $clientPlayer
- id of the player who's behind this client
instance
private static GameController instance
$playerList
private PlayerList $playerList
DEBUG
private static final boolean DEBUG
- See Also:
- Constant Field Values
$boardModel
private BoardModel $boardModel
$boardController
private BoardController $boardController
$cardController
private CardController $cardController
GameController
private GameController()
- private constructor because this class is a singleton
getInstance
public static GameController getInstance()
connectToServer
public void connectToServer(java.lang.String server,
int port,
java.lang.String playerName,
int playerMode)
- makes a connection with the server
startGame
public void startGame(int gameType)
getPlayerMode
public int getPlayerMode()
getPlayerList
public PlayerList getPlayerList()
getCountryList
public CountryList getCountryList()
messageArrived
public void messageArrived(Message m)
- Specified by:
messageArrived in interface MessageListener
getBoardModel
public BoardModel getBoardModel()
getBoardController
public BoardController getBoardController()
getCardController
public CardController getCardController()
getClientPlayer
public Player getClientPlayer()
setClientPlayerID
public void setClientPlayerID(int id)
getBoardMapFileName
public java.lang.String getBoardMapFileName()