org.starhope.appius.game
Interface AbstractRoom

All Known Implementing Classes:
RemoteRoom, Room

public interface AbstractRoom

WRITEME: The documentation for this type (AbstractRoom) is incomplete. (brpocock, Jan 11, 2010)

Author:
brpocock

Method Summary
 void add(GameEvent game)
           
 boolean contains(AbstractUser user)
          TODO: document this method (brpocock, Oct 28, 2009)
 void deleteVariable(String string)
           
 void destroySelf()
          WRITEME
 void flush()
          This is an overriding method.
 void fromJSON(org.json.JSONObject jso)
          TODO: document this method (brpocock, Oct 21, 2009)
 Set<RoomListener> getAllListeners()
           
 Collection<AbstractUser> getAllUsers()
           
 String getDebugName()
           Get the debugging version of the room's name.
 String getFilename()
           
 GameEvent getGameEvent()
           
 int getId()
          Deprecated. 
 int getID()
           
 Collection<RoomListener> getListeners()
          TODO: document this method (brpocock, Nov 24, 2009)
 int getMaxUsers()
           
 String getMoniker()
           
 String getMusic()
          TODO: document this method (brpocock, Oct 13, 2009)
 String getName()
           
 String getOverlay()
           
 AbstractUser getOwner()
           
 int getRoomIndex()
           Get the index of this room within the set of rooms to which it belongs.
 String getSky()
           
 String getTitle()
          Get the room's string title
 int getUserCount()
           
 String getVariable(String string)
           
 HashMap<String,String> getVariables()
          Get the set of all variables which are attached to this room
 AbstractZone getZone()
           
 int hashCode()
          This is an overriding method.
 boolean isLimbo()
           A “limbo” room is a room in which no public messaging is carried out.
 boolean isSkyVisible()
           
 void join(RoomListener thing)
          Notify this room (and anyone in it) that someone has joined
 void part(RoomListener roomListener)
           
 void sendGameAction(User from, org.json.JSONObject data)
          Propagate a game event to every user in the room.
 void sendPublicMessage(AbstractUser from, String speech)
           
 void setFilename(String filename1)
           
 void setLimbo(boolean b)
           
 void setMoniker(String moniker1)
           
 void setMusic(String music1)
           
 void setOverlay(String overlay1)
           
 void setOwner(AbstractUser newHomeOwner)
          TODO: document this method (brpocock, Jan 13, 2010)
 void setRoomVars()
          WRITEME
 void setSky(String sky1)
           
 void setSkyVisible(boolean skyVisible1)
           
 void setTitle(String newTitle)
          TODO: document this method (brpocock, Oct 5, 2009)
 void setVariable(Map.Entry<String,String> var)
           
 void setVariable(String varName, String varValue)
          Set a room variable.
 void setVariables(Map<String,String> map)
           
 org.json.JSONObject toJSON()
           
 

Method Detail

add

void add(GameEvent game)
Parameters:
game - WRITEME

contains

boolean contains(AbstractUser user)
TODO: document this method (brpocock, Oct 28, 2009)

Parameters:
user - who
Returns:
true if they are in this room

deleteVariable

void deleteVariable(String string)
Parameters:
string - WRITEME

destroySelf

void destroySelf()
WRITEME


flush

void flush()
This is an overriding method.

See Also:
SQLPeerDatum.flush()

fromJSON

void fromJSON(org.json.JSONObject jso)
              throws org.json.JSONException
TODO: document this method (brpocock, Oct 21, 2009)

Parameters:
jso - Serialized form
Throws:
org.json.JSONException - if the incoming data isn't in the right form

getAllListeners

Set<RoomListener> getAllListeners()
Returns:
WRITEME

getAllUsers

Collection<AbstractUser> getAllUsers()
Returns:
WRITEME

getDebugName

String getDebugName()

Get the debugging version of the room's name. This is based upon the moniker and zone, or identifies the room as an abstract room if it is not a part of a zone.

Returns:
A string uniquely identifying this room for debugging purposes.

getFilename

String getFilename()
Returns:
the filename

getGameEvent

GameEvent getGameEvent()
Returns:
The Game Event in this room, or (usually) null

getId

@Deprecated
int getId()
Deprecated. 

Smart Fox Server misspelling of getID()

Returns:
the room's ID number

getID

int getID()
Returns:
the room's ID number

getListeners

Collection<RoomListener> getListeners()
TODO: document this method (brpocock, Nov 24, 2009)

Returns:
all RoomListeners, including all users and observers

getMaxUsers

int getMaxUsers()
Returns:
WRITEME

getMoniker

String getMoniker()
Returns:
the moniker

getMusic

String getMusic()
TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

getName

String getName()
Returns:
WRITEME

getOverlay

String getOverlay()
Returns:
the overlay

getOwner

AbstractUser getOwner()
Returns:
the owner of this room, if this is a private (user-created) room; else, null.

getRoomIndex

int getRoomIndex()

Get the index of this room within the set of rooms to which it belongs.

For user-created rooms, this is the index of the room number within the user's “house,” typically 0 for the first room, 1 for the yard, and 2 or more for additional rooms.

The meaning of this index varies depending upon context; presently, it is only meaningful for user houses.

Returns:
the index of this room

getSky

String getSky()
Returns:
the file to load for the sky of this room

getTitle

String getTitle()
Get the room's string title

Returns:
the user-visible title of the room

getUserCount

int getUserCount()
Returns:
the number of users in the room

getVariable

String getVariable(String string)
Parameters:
string - the variable name for which the value is requested
Returns:
the value of that variable, if any, or null, if no such variable is attached to this room

getVariables

HashMap<String,String> getVariables()
Get the set of all variables which are attached to this room

Returns:
room variables

getZone

AbstractZone getZone()
Returns:
The zone in which this Room is found

hashCode

int hashCode()
This is an overriding method.

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

isLimbo

boolean isLimbo()

A “limbo” room is a room in which no public messaging is carried out. Users are unaware of one another's presence, comings and goings, and there are no public messages. The default “limbo” room is named “nowhere”

Returns:
true, if this is a limbo room

isSkyVisible

boolean isSkyVisible()
Returns:
true, if the sky is visible in this room; else, false

join

void join(RoomListener thing)
Notify this room (and anyone in it) that someone has joined

Parameters:
thing - the thing that has joined the room

part

void part(RoomListener roomListener)
Parameters:
roomListener - the thing which wants to stop listening to the room

sendGameAction

void sendGameAction(User from,
                    org.json.JSONObject data)
                    throws org.json.JSONException
Propagate a game event to every user in the room.

Parameters:
from - WRITEME
data - WRITEME
Throws:
org.json.JSONException - if the action can't be represented in JSON

sendPublicMessage

void sendPublicMessage(AbstractUser from,
                       String speech)
Parameters:
from - WRITEME
speech - WRITEME

setFilename

void setFilename(String filename1)
Parameters:
filename1 - the filename to set

setLimbo

void setLimbo(boolean b)
Parameters:
b - true, if this is a limbo room

setMoniker

void setMoniker(String moniker1)
Parameters:
moniker1 - the moniker to set

setMusic

void setMusic(String music1)
Parameters:
music1 - the new background music

setOverlay

void setOverlay(String overlay1)
Parameters:
overlay1 - the overlay to set

setOwner

void setOwner(AbstractUser newHomeOwner)
TODO: document this method (brpocock, Jan 13, 2010)

Parameters:
newHomeOwner - new home owner

setRoomVars

void setRoomVars()
WRITEME


setSky

void setSky(String sky1)
Parameters:
sky1 - the sky to set

setSkyVisible

void setSkyVisible(boolean skyVisible1)
Parameters:
skyVisible1 - the skyVisible to set

setTitle

void setTitle(String newTitle)
TODO: document this method (brpocock, Oct 5, 2009)

Parameters:
newTitle - WRITEME

setVariable

void setVariable(Map.Entry<String,String> var)
Parameters:
var - A Hash type Entry object containing a key-value pair to be used to set a variable.

setVariable

void setVariable(String varName,
                 String varValue)
Set a room variable. Room variables are transmitted to users upon joining a room (unless that room's “limbo” flag is set), and if they are changed, the changes propagate to everyone listening to that room (again, unless the room is in “limbo”)

Parameters:
varName - the name of the room variable to alter
varValue - the new value

setVariables

void setVariables(Map<String,String> map)
Parameters:
map - a map containing variables and

toJSON

org.json.JSONObject toJSON()
Returns:
the room's JSON representation