Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.zazof.jteg
Class GameController  view GameController download GameController.java

java.lang.Object
  extended byorg.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


Field Summary
private  BoardController $boardController
           
private  BoardModel $boardModel
           
private  CardController $cardController
           
private  int $clientPlayer
          id of the player who's behind this client
private  PlayerList $playerList
           
private  int $playerMode
          o = observer, 1 = player
private static boolean DEBUG
           
private static GameController instance
           
 
Constructor Summary
private GameController()
          private constructor because this class is a singleton
 
Method Summary
 void connectToServer(java.lang.String server, int port, java.lang.String playerName, int playerMode)
          makes a connection with the server
 BoardController getBoardController()
           
 java.lang.String getBoardMapFileName()
           
 BoardModel getBoardModel()
           
 CardController getCardController()
           
 Player getClientPlayer()
           
 CountryList getCountryList()
           
static GameController getInstance()
           
 PlayerList getPlayerList()
           
 int getPlayerMode()
           
 void messageArrived(Message m)
           
 void setClientPlayerID(int id)
           
 void startGame(int gameType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$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
Constructor Detail

GameController

private GameController()
private constructor because this class is a singleton

Method Detail

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()