|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.limdul.cassiopeia.control.servermodus.ServerModus
public abstract class ServerModus
Oberklasse für alle Servermodi. Stellt Grundlegende Methoden zur Behandlung zur Verfügung.
| Field Summary | |
|---|---|
static int |
CONNECTING
|
static int |
END_GAME
|
static int |
GAME_CASTLE_MISS
|
static int |
GAME_DRAGON_UPDATE_POINTS
|
static int |
GAME_ENCHANTED_TUNNEL
|
static int |
GAME_INFO
|
static int |
GAME_MOVE_DRAGON
|
static int |
GAME_PLACE_DRAGON
|
static int |
GAME_PLACE_FAIRY
|
static int |
GAME_PLACE_RIVER_2_CROSSING
|
static int |
GAME_PLAY_CARD
|
static int |
GAME_PLAY_FIGURE
|
static int |
GAME_PLAY_KATHARER
|
static int |
GAME_SELECT_MOVE_DRAGON
|
static int |
GAME_SELECT_PLACE_DRAGON
|
static int |
GAME_UPDATE_POINTS
|
static int |
LOBBY
|
static int |
START_GAME
|
static int |
UNKNOWN_MODUS
Gibt an, dass die Spiellogik den Modus entscheidet. |
| Constructor Summary | |
|---|---|
ServerModus(EventHandler handler)
Erzeugt einen Servermodus. |
|
| Method Summary | |
|---|---|
void |
addClient(String client)
Fügt einen Client zur Liste der betroffenen Clients hinzu. |
protected void |
addExpectedTCP(int command)
Fügt einen BEfehl zur Liste der erwarteten TCP Befehle hinzu. |
protected void |
addToReplay(TCPCommand command)
Fügt einen Befehl zum Replay hinzu. |
protected void |
clearExpectedTCP()
Löscht die Liste der erwarten TCP Befehle. |
protected void |
createModus(int newModus)
Erzeugt einen neuen Servermodus. |
protected EventHandler |
getEventHandler()
Liefert den Eventhandler. |
protected CassiopeiaGame |
getGame()
Liefert das Spiel. |
protected GameLogic |
getGameLogic()
Liefert das Spiellogik Objekt. |
abstract int |
getType()
Liefert den Typ des Modus. |
protected void |
initialize()
Wird aufgerufen, nachdem das Objekt erfolgreich erzeugt wurde. |
protected boolean |
isLocalGame()
Liefert zurück, ob es sich um ein lokales Spiel handelt. |
protected void |
parseChatMessage(TCPChatMessage command)
Verarbeitet eine Chatnachricht. |
void |
parseGameCommand(GameCommand command)
Verarbeitet ein GameCommand. |
void |
removeClient(String client)
Entfernt einen Client vone der Liste der betroffenen Clients. |
protected void |
sendCommand(TCPCommand command)
Sendet den Befehl nur an die Clients, die von diesem Modus betroffen sind. |
protected void |
sendCommand(TCPCommand command,
boolean save)
Sendet den Befehl nur an die Clients, die von diesem Modus betroffen sind. |
protected void |
sendGameOptions()
Sendet die Spieloptionen. |
void |
setConnection(ConnectionWaiting conWait)
Setzt das ConnectioNWaiting Objekt. |
void |
setEventHandler(EventHandler handler)
Setzt den Ereignisshandler, der für die Verteilung von Ereignissen zuständig ist. |
protected void |
setGameLogic(GameLogic logic)
Setzt das Spiellogik Objekt. |
void |
shutdown()
Beendet den Server. |
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 |
| Field Detail |
|---|
public static final int UNKNOWN_MODUS
public static final int CONNECTING
ServerConnecting,
Constant Field Valuespublic static final int LOBBY
ServerLobby,
Constant Field Valuespublic static final int GAME_PLAY_CARD
ServerPlayCard,
Constant Field Valuespublic static final int START_GAME
ServerStartGame,
Constant Field Valuespublic static final int GAME_PLAY_FIGURE
ServerPlayFigure,
Constant Field Valuespublic static final int GAME_UPDATE_POINTS
ServerUpdatePoints,
Constant Field Valuespublic static final int GAME_ENCHANTED_TUNNEL
ServerEnchantedTunnel,
Constant Field Valuespublic static final int GAME_CASTLE_MISS
ServerPlayCastleMiss,
Constant Field Valuespublic static final int GAME_PLACE_FAIRY
ServerPlaceFairy,
Constant Field Valuespublic static final int END_GAME
ServerEndGame,
Constant Field Valuespublic static final int GAME_PLACE_DRAGON
ServerPlaceDragon,
Constant Field Valuespublic static final int GAME_SELECT_PLACE_DRAGON
ServerSelectPlaceDragon,
Constant Field Valuespublic static final int GAME_SELECT_MOVE_DRAGON
ServerSelectMoveDragon,
Constant Field Valuespublic static final int GAME_MOVE_DRAGON
ServerMoveDragon,
Constant Field Valuespublic static final int GAME_DRAGON_UPDATE_POINTS
ServerDragonUpdatePoints,
Constant Field Valuespublic static final int GAME_PLAY_KATHARER
ServerPlayFigure,
Constant Field Valuespublic static final int GAME_PLACE_RIVER_2_CROSSING
ServerPlaceRiver2Crossing,
Constant Field Valuespublic static final int GAME_INFO
ServerGameInfo,
Constant Field Values| Constructor Detail |
|---|
public ServerModus(EventHandler handler)
handler - Der Ereignisshandler.| Method Detail |
|---|
public abstract int getType()
public void addClient(String client)
client - Die Nummer des hinzufügenden Clients.public void removeClient(String client)
client - Die Nummer des zu entfernden Clients.public void setConnection(ConnectionWaiting conWait)
conWait - Das ConnectionWaiting Objekt.public void parseGameCommand(GameCommand command)
GameCommandListenerGameCommand.
parseGameCommand in interface GameCommandListenercommand - Das GameCommandGameCommandListener.parseGameCommand(de.limdul.cassiopeia.control.gamecommands.GameCommand)public void shutdown()
protected final void createModus(int newModus)
newModus - Der gewünschte Modus.protected final boolean testTCPCommand(TCPCommand command)
Normal,
da der Client auch veraltete Befehle schicken kann.
command - Der Befehl
true wenn es nicht verarbeitet werden soll, false sonst.
protected final void sendCommand(TCPCommand command,
boolean save)
command - Der zu sendende Befehl.save - Ob der Befehl gespeichert werden soll für Zuschauer, die beitretenprotected final void sendCommand(TCPCommand command)
command - Der zu sendende Befehl.public final void setEventHandler(EventHandler handler)
CassiopeiaListener
setEventHandler in interface CassiopeiaListenerhandler - Der EreignisshandlerCassiopeiaListener.setEventHandler(de.limdul.cassiopeia.control.EventHandler)protected final void clearExpectedTCP()
protected final void addExpectedTCP(int command)
command - Der hinzuzufügenden Befehl.protected final EventHandler getEventHandler()
protected final CassiopeiaGame getGame()
protected final void sendGameOptions()
TCPTools.sendGameOptions(GameOptions, EventHandler, String) zurück.
protected void initialize()
protected void parseChatMessage(TCPChatMessage command)
command - Die Chatnachricht.protected final GameLogic getGameLogic()
protected final void setGameLogic(GameLogic logic)
logic - Das Spiellogik Objekt.protected final void addToReplay(TCPCommand command)
command - Der Befehl, der zum Replay hinzugefügt werden soll.protected final boolean isLocalGame()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||