|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.spieleck.game.base.GamePlaceBase
A default implementation for GamePlace
Constructor Summary | |
GamePlaceBase()
|
Method Summary | |
boolean |
canWatch(GameSpectator s)
can join, can be matter rights, roles, game rules or whatever. |
void |
dispatchUpdateMessage(UpdateMessage msg)
A Spectable can be made responsible to distribute certain Events to it's Spectators. |
GamePlace |
getParent()
Get the Places parent Place. |
java.lang.String |
getPlaceName()
Every GamePlace should have a name. |
int |
getPlayerCount()
Return the number of players currently in the game |
java.util.Iterator |
getPlayers()
GameState API. |
java.lang.String |
getSpectatorName()
|
java.util.Iterator |
getSpectators()
get Spectators |
int |
getSpectatorsCount()
Return the number of Spectators currently in the collection |
boolean |
isIn(GamePlayer p)
GameState API. |
boolean |
isWatching(GameSpectator s)
Check weather a certain Spectator is in the collection. |
void |
join(GamePlayer p)
add a new Player if joining is not allowed, an Exception is thrown |
void |
leave(GamePlayer p)
removes the given player from the players list |
void |
setParent(GamePlace parentPlace)
We use a Parent link at times. |
protected void |
setPlayers(PlayerCollection players)
Since we want to manage Players we use a PlayerCollection |
protected void |
setSpectators(SpectatorCollection spectators)
Since we want to manage Players we use a PlayerCollection |
void |
turnAway(GameSpectator s)
removes the given Spectator from the spectators list |
void |
watch(GameSpectator s)
add a new Spectator if joining is not allowed, an Exception is thrown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.spieleck.game.base.GamePlace |
getPlaceLocalName |
Methods inherited from interface de.spieleck.game.base.GameSpectator |
notifyUpdate |
Methods inherited from interface de.spieleck.game.base.PlayerCollection |
canJoin, canLeave |
Constructor Detail |
public GamePlaceBase()
Method Detail |
protected void setSpectators(SpectatorCollection spectators)
protected void setPlayers(PlayerCollection players)
public java.lang.String getPlaceName()
getPlaceName
in interface GamePlace
public java.lang.String getSpectatorName()
getSpectatorName
in interface GameSpectator
public void setParent(GamePlace parentPlace)
setParent
in interface GamePlace
public GamePlace getParent()
getParent
in interface GamePlace
public void watch(GameSpectator s) throws GameException
SpectatorCollection
watch
in interface SpectatorCollection
public void turnAway(GameSpectator s) throws GameException
SpectatorCollection
turnAway
in interface SpectatorCollection
public boolean isWatching(GameSpectator s) throws GameException
ReadableSpectatorCollection
isWatching
in interface ReadableSpectatorCollection
public void join(GamePlayer p) throws GameException
PlayerCollection
join
in interface PlayerCollection
public void leave(GamePlayer p) throws GameException
PlayerCollection
leave
in interface PlayerCollection
public int getPlayerCount()
ReadablePlayerCollection
getPlayerCount
in interface ReadablePlayerCollection
public java.util.Iterator getSpectators()
getSpectators
in interface ReadableSpectatorCollection
public java.util.Iterator getPlayers()
getPlayers
in interface ReadablePlayerCollection
public boolean isIn(GamePlayer p)
isIn
in interface ReadablePlayerCollection
public int getSpectatorsCount()
ReadableSpectatorCollection
getSpectatorsCount
in interface ReadableSpectatorCollection
public boolean canWatch(GameSpectator s)
SpectatorCollection
canWatch
in interface SpectatorCollection
public void dispatchUpdateMessage(UpdateMessage msg)
dispatchUpdateMessage
in interface Spectable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |