|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.limdul.cassiopeia.control.gamemodus.GameModus
public abstract class GameModus
Oberklasse für alle Spielmodi, die die Steuerung enthalten.
| Field Summary | |
|---|---|
static int |
CONNECTING
|
static int |
GAME_INFO
|
static int |
GAME_MOVE_DRAGON_OTHER
|
static int |
GAME_MOVE_DRAGON_OWN
|
static int |
GAME_PLACE_FAIRY_OTHER
|
static int |
GAME_PLACE_FAIRY_OWN
|
static int |
GAME_PLAY_CARD_OTHER
|
static int |
GAME_PLAY_CARD_OWN
|
static int |
GAME_PLAY_CASTLE_MISS_OTHER
|
static int |
GAME_PLAY_CASTLE_MISS_OWN
|
static int |
GAME_PLAY_ENCHANTED_TUNNEL
|
static int |
GAME_PLAY_FIGURE_OTHER
|
static int |
GAME_PLAY_FIGURE_OWN
|
static int |
GAME_PLAY_KATHARER_OTHER
|
static int |
GAME_PLAY_KATHARER_OWN
|
static int |
GAME_SELECT_DRAGON_OTHER
|
static int |
GAME_SELECT_DRAGON_OWN
|
static int |
GAME_WAITING
|
static int |
LOBBY
|
| Constructor Summary | |
|---|---|
GameModus()
|
|
| Method Summary | |
|---|---|
protected void |
addExpectedGame(int command)
Fügt ein neues GameCommand zu den erwarteten GameCommands hinzu. |
protected void |
addExpectedTCP(int command)
Fügt ein neues TCPCommand zu den erwarteten TCPCommands hinzu. |
protected void |
clearExpectedGame()
Leert die Liste der erwarteten GameCommands. |
protected void |
clearExpectedTCP()
Leert die Liste der erwarteten TCPCommand. |
protected void |
createNewGameModi(int modus)
Erzeugt den neuen GameModus. |
EventHandler |
getEventHandler()
Liefert den Eventhandler. |
protected CassiopeiaGame |
getGame()
Liefert das Spielobjekt. |
protected Player |
getOwnPlayer()
Liefert den eignen Spieler. |
protected int |
getOwnPlayerNumber()
Liefert den Index des eignenen Spielers. |
abstract int |
getType()
Liefert den Typ des Modus. |
protected boolean |
isOwnPlayer(Player player)
Testet, ob der Spieler der eigene Spieler ist. |
protected boolean |
isOwnPlayer(String internalIdentifier)
Testet,ob der Identifier der eigene Spieler ist. |
void |
parseGameChatMessage(GameChatMessage command)
Verarbeitet eine Nachricht zum chatten von der Gui. |
void |
parseTCPChatMessage(TCPChatMessage command)
Verarbeitet eine Nachricht zum chatten vom Server. |
void |
setCommunicator(ClientCommunicator com)
Setzt den ClientCommunicator. |
void |
setEventHandler(EventHandler handler)
Setzt den Ereignisshandler, der für die Verteilung von Ereignissen zuständig ist. |
void |
setGame(CassiopeiaGame game)
Setzt das Spielobjekt. |
protected void |
setMeta(boolean isMeta)
Setzt, ob es sich um ein Spiel auf dem Metaserver handelt. |
protected void |
shutdown()
Beendet den Client. |
protected boolean |
testGameCommand(GameCommand command)
Testet, ob das GameCommand verarbeitet werden soll. |
protected boolean |
testTCPCommand(TCPCommand command)
Testet, ob das TCPCommand verarbeitet werden soll. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.limdul.cassiopeia.control.TCPCommandListener |
|---|
parseTCPCommand |
| Methods inherited from interface de.limdul.cassiopeia.control.GameCommandListener |
|---|
parseGameCommand |
| Field Detail |
|---|
public static final int CONNECTING
Connecting,
Constant Field Valuespublic static final int LOBBY
Lobby,
Constant Field Valuespublic static final int GAME_WAITING
GameWaiting,
Constant Field Valuespublic static final int GAME_PLAY_CARD_OWN
GamePlayCardOwn,
Constant Field Valuespublic static final int GAME_PLAY_CARD_OTHER
GamePlayCardOther,
Constant Field Valuespublic static final int GAME_PLAY_FIGURE_OWN
GamePlayFigureOwn,
Constant Field Valuespublic static final int GAME_PLAY_FIGURE_OTHER
GamePlayFigureOther,
Constant Field Valuespublic static final int GAME_PLAY_ENCHANTED_TUNNEL
GamePlayEnchantedTunnel,
Constant Field Valuespublic static final int GAME_PLAY_CASTLE_MISS_OWN
GamePlayCastleMissOwn,
Constant Field Valuespublic static final int GAME_PLAY_CASTLE_MISS_OTHER
GamePlayCastleMissOther,
Constant Field Valuespublic static final int GAME_PLACE_FAIRY_OWN
GamePlaceFairyOwn,
Constant Field Valuespublic static final int GAME_PLACE_FAIRY_OTHER
GamePlaceFairyOther,
Constant Field Valuespublic static final int GAME_SELECT_DRAGON_OWN
GameSelectDragonOwn,
Constant Field Valuespublic static final int GAME_SELECT_DRAGON_OTHER
GameSelectDragonOwn,
Constant Field Valuespublic static final int GAME_MOVE_DRAGON_OWN
GameMoveDragonOwn,
Constant Field Valuespublic static final int GAME_MOVE_DRAGON_OTHER
GameMoveDragonOther,
Constant Field Valuespublic static final int GAME_PLAY_KATHARER_OWN
GamePlayKatharerOwn,
Constant Field Valuespublic static final int GAME_PLAY_KATHARER_OTHER
GamePlayKatharerOther,
Constant Field Valuespublic static final int GAME_INFO
GameInfo,
Constant Field Values| Constructor Detail |
|---|
public GameModus()
| Method Detail |
|---|
public abstract int getType()
public void setCommunicator(ClientCommunicator com)
com - Der ClientCommunicator.public void setEventHandler(EventHandler handler)
CassiopeiaListener
setEventHandler in interface CassiopeiaListenerhandler - Der EreignisshandlerCassiopeiaListener.setEventHandler(de.limdul.cassiopeia.control.EventHandler)public EventHandler getEventHandler()
protected final void setMeta(boolean isMeta)
isMeta - Ob es sich um ein Spiel auf dem Metaserver handelt.protected void createNewGameModi(int modus)
modus - Der Schlüssel des gewünschten Neuen Modus.public void setGame(CassiopeiaGame game)
game - Das Spielobjekt.protected boolean isOwnPlayer(Player player)
player - Der zu testende Spieler.
true, wenn es der eigene Spieler ist, false sonst.protected CassiopeiaGame getGame()
protected boolean isOwnPlayer(String internalIdentifier)
internalIdentifier - Der Identifier des zu testenden Spielers
true, wenn es der eigene Spieler ist, false sonst.protected Player getOwnPlayer()
protected final void clearExpectedGame()
protected final void clearExpectedTCP()
protected final void addExpectedTCP(int command)
command - Das erwartete TCPCommandprotected final void addExpectedGame(int command)
command - Das erwartete GameCommandprotected final boolean testGameCommand(GameCommand command)
Normal,
da es vorkommen kann, dass die GUI Befehle generiert, die veraltet sind.
command - Der Befehl
true wenn es nicht verarbeitet werden soll, false sonst.protected final boolean testTCPCommand(TCPCommand command)
Warning,
da eigentlich nur erwartete Befehle vom Server kommen sollten.
command - Der Befehl
true wenn es nicht verarbeitet werden soll, false sonst.protected final int getOwnPlayerNumber()
protected final void shutdown()
public void parseGameChatMessage(GameChatMessage command)
command - Die Nachricht.public void parseTCPChatMessage(TCPChatMessage command)
command - Die Nachricht.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||