| 
|||||||||
| 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 GamePlacepublic java.lang.String getSpectatorName()
getSpectatorName in interface GameSpectatorpublic void setParent(GamePlace parentPlace)
setParent in interface GamePlacepublic GamePlace getParent()
getParent in interface GamePlace
public void watch(GameSpectator s)
           throws GameException
SpectatorCollectionwatch in interface SpectatorCollection
public void turnAway(GameSpectator s)
              throws GameException
SpectatorCollectionturnAway in interface SpectatorCollection
public boolean isWatching(GameSpectator s)
                   throws GameException
ReadableSpectatorCollectionisWatching in interface ReadableSpectatorCollection
public void join(GamePlayer p)
          throws GameException
PlayerCollectionjoin in interface PlayerCollection
public void leave(GamePlayer p)
           throws GameException
PlayerCollectionleave in interface PlayerCollectionpublic int getPlayerCount()
ReadablePlayerCollectiongetPlayerCount in interface ReadablePlayerCollectionpublic java.util.Iterator getSpectators()
getSpectators in interface ReadableSpectatorCollectionpublic java.util.Iterator getPlayers()
getPlayers in interface ReadablePlayerCollectionpublic boolean isIn(GamePlayer p)
isIn in interface ReadablePlayerCollectionpublic int getSpectatorsCount()
ReadableSpectatorCollectiongetSpectatorsCount in interface ReadableSpectatorCollectionpublic boolean canWatch(GameSpectator s)
SpectatorCollectioncanWatch in interface SpectatorCollectionpublic void dispatchUpdateMessage(UpdateMessage msg)
dispatchUpdateMessage in interface Spectable
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||