|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.game.Room
public class Room
WRITEME: The documentation for this type (Room) is incomplete. (brpocock, Aug 18, 2009)
Field Summary | |
---|---|
private static String |
fairgroundsImage
WRITEME |
private static String |
fairgroundsLabel
WRITEME |
private static String |
fairgroundsWarp
WRITEME |
private String |
filename
The base name of the room's SWF file. |
private GameEvent |
gameEvent
The Game Event in this room, or (usually) null |
private AbstractUser |
homeOwner
The owner of a room; usually null for public rooms, or non-null for users' houses. |
private boolean |
iAmInLimbo
Determine whether this room is a limbo room |
private String |
moniker
The moniker / unique identifier for this room. |
private int |
movieTime
in seconds |
private String |
movieURL
TODO: document this field (brpocock, Nov 13, 2009) movieURL (Room) |
private String |
music
The background music for the room |
private int |
myID
TODO: document this field (brpocock, Nov 13, 2009) myID (Room) |
private String |
nowPlaying
TODO: document this field (brpocock, Nov 13, 2009) nowPlaying (Room) |
private ConcurrentSkipListSet<RoomListener> |
observers
Non-Users who are present to pay attention to things happening in the room |
private String |
overlay
The SWF file to be displayed as a weather overlay. |
private int |
roomIndex
WRITEME: document this field (brpocock, Jan 14, 2010) roomIndex (Room) |
private ConcurrentHashMap<String,String> |
roomVariables
WRITEME |
private static int |
safeRoomNum
TODO: document this field (brpocock, Nov 13, 2009) safeRoomNum (Room) |
private static long |
serialVersionUID
TODO: document this field (brpocock, Oct 5, 2009) serialVersionUID (long) |
private String |
sky
The SWF file to be displayed as a sky background. |
private boolean |
skyVisible
Whether the sky is visible in this room. |
private String |
title
WRITEME |
private ConcurrentSkipListSet<Integer> |
userList
The list of user ID's of all users in this room. |
private AbstractZone |
zone
The zone in which this room exists |
Constructor Summary | |
---|---|
|
Room(AbstractZone homeZone)
|
private |
Room(ResultSet rs,
AbstractZone newZone)
Instantiate a room based upon the theoretical room dataset from the database and the Zone into which it should be instantiated. |
|
Room(String newRoomMoniker,
AbstractZone newRoomZone)
|
Method Summary | |
---|---|
void |
add(GameEvent game)
This is an overriding method. |
int |
compareTo(AbstractRoom other)
|
boolean |
contains(AbstractUser thing)
This is an overriding method. |
static Room |
create(String roomName,
AbstractZone zone)
TODO: document this method (brpocock, Oct 19, 2009) |
static Room |
create(String roomName,
AbstractZone abstractZone,
boolean mustExist)
|
void |
deleteVariable(String string)
This is an overriding method. |
void |
destroySelf()
This is an overriding method. |
boolean |
equals(AbstractRoom other)
This is an overriding method. |
boolean |
equals(Object other)
This is an overriding method. |
void |
flush()
This is an overriding method. |
void |
fromJSON(org.json.JSONObject jso)
This is an overriding method. |
Set<RoomListener> |
getAllListeners()
This is an overriding method. |
static AbstractRoom[] |
getAllRooms()
|
Collection<AbstractUser> |
getAllUsers()
This is an overriding method. |
private HashMap<String,String> |
getArbitraryVars()
Load arbitrary room variable values from the database |
static Room |
getByMoniker(String moniker,
Zone zone)
|
protected String |
getCacheUniqueID()
This is an overriding method. |
String |
getDebugName()
This is an overriding method. |
private Set<AbstractUser> |
getEverythingInRoom()
TODO: document this method (brpocock, Nov 24, 2009) |
private void |
getFairground()
WRITEME: document this method (brpocock, Aug 31, 2009) |
String |
getFilename()
This is an overriding method. |
GameEvent |
getGameEvent()
This is an overriding method. |
int |
getId()
Deprecated. |
int |
getID()
This is an overriding method. |
Collection<RoomListener> |
getListeners()
This is an overriding method. |
int |
getMaxUsers()
This is an overriding method. |
String |
getMoniker()
This is an overriding method. |
private void |
getMovie()
WRITEME: document this method (brpocock, Aug 31, 2009) |
String |
getMusic()
This is an overriding method. |
String |
getName()
This is an overriding method. |
private static int |
getNextID()
TODO: document this method (brpocock, Oct 19, 2009) |
String |
getOverlay()
This is an overriding method. |
AbstractUser |
getOwner()
|
int |
getRoomIndex()
Get the index of this room within the set of rooms to which it belongs. |
private String |
getRoomJoinSFSXML(User user)
TODO: document this method (brpocock, Dec 29, 2009) |
String |
getSky()
This is an overriding method. |
private org.json.JSONObject |
getSuperTootBots_JSON()
Deprecated. Needs to be moved someplace more appropriate ... not yet determined ... |
org.json.JSONObject |
getSuperTootBots(int padding)
Deprecated. Does not belong in Room ... but will be removed when NPC's work and Super Toot Bots can be removed from the codebase ... don't count on this being around forever, but it won't disappear as long as Super Toot Bots exist. |
String |
getTitle()
This is an overriding method. |
int |
getUserCount()
This is an overriding method. |
String |
getVariable(String string)
This is an overriding method. |
HashMap<String,String> |
getVariables()
This is an overriding method. |
AbstractZone |
getZone()
This is an overriding method. |
int |
hashCode()
This is an overriding method. |
boolean |
isLimbo()
This is an overriding method. |
boolean |
isSkyVisible()
This is an overriding method. |
void |
join(RoomListener thing)
This is an overriding method. |
void |
part(RoomListener thing)
This is an overriding method. |
void |
sendGameAction(User from,
org.json.JSONObject data)
This is an overriding method. |
void |
sendPublicMessage(AbstractUser from,
String speech)
This is an overriding method. |
protected void |
set(ResultSet rs)
This is an overriding method. |
void |
setFilename(String filename1)
This is an overriding method. |
void |
setLimbo(boolean b)
This is an overriding method. |
void |
setMoniker(String moniker1)
This is an overriding method. |
void |
setMusic(String music1)
This is an overriding method. |
void |
setOverlay(String overlay1)
This is an overriding method. |
void |
setOwner(AbstractUser newHomeOwner)
TODO: document this method (brpocock, Jan 13, 2010) |
void |
setRoomIndex(int newRoomIndex)
|
void |
setRoomVars()
This is an overriding method. |
void |
setSky(String sky1)
This is an overriding method. |
void |
setSkyVisible(boolean skyVisible1)
This is an overriding method. |
void |
setTitle(String newTitle)
This is an overriding method. |
void |
setVariable(Map.Entry<String,String> var)
This is an overriding method. |
void |
setVariable(String varName,
String varValue)
This is an overriding method. |
void |
setVariables(Map<String,String> map)
This is an overriding method. |
private void |
superbot_fetchBasicInfo(ResultSet rs,
ResultSet botGot,
org.json.JSONObject bot,
org.json.JSONObject speech,
org.json.JSONObject avatar)
TODO: document this method (brpocock, Dec 29, 2009) |
private void |
superbot_fetchClothing(ResultSet rs,
org.json.JSONObject clothes)
TODO: document this method (brpocock, Dec 29, 2009) |
private void |
superbot_fetchPattern(ResultSet rs,
org.json.JSONObject clothes)
TODO: document this method (brpocock, Dec 29, 2009) |
private org.json.JSONObject |
superbot_fetchSpeech(PreparedStatement getSpeech,
ResultSet rs)
TODO: document this method (brpocock, Dec 29, 2009) |
org.json.JSONObject |
toJSON()
This is an overriding method. |
private void |
validateUserList()
TODO: document this method (brpocock, Oct 23, 2009) |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, saveInCache, set |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static String fairgroundsImage
private static String fairgroundsLabel
private static String fairgroundsWarp
private static int safeRoomNum
private static final long serialVersionUID
private String filename
private GameEvent gameEvent
private AbstractUser homeOwner
The owner of a room; usually null for public rooms, or non-null for users' houses.
The special room variable homeOwner reflects this.
private transient boolean iAmInLimbo
discussion of Limbo on
AbstractRoom.isLimbo ()
private String moniker
private int movieTime
private String movieURL
private String music
private int myID
private String nowPlaying
private final ConcurrentSkipListSet<RoomListener> observers
private String overlay
private int roomIndex
private final ConcurrentHashMap<String,String> roomVariables
private String sky
private boolean skyVisible
private String title
private final ConcurrentSkipListSet<Integer> userList
private transient AbstractZone zone
Constructor Detail |
---|
public Room(AbstractZone homeZone)
homeZone
- WRITEMEprivate Room(ResultSet rs, AbstractZone newZone) throws SQLException
rs
- The theoretical room datasetnewZone
- The zone into which the room should be
instantiated
SQLException
- if the room dataset can't be interpretedpublic Room(String newRoomMoniker, AbstractZone newRoomZone) throws NotFoundException
newRoomMoniker
- The moniker of the room to be instantiatednewRoomZone
- WRITEME
NotFoundException
- if there is no room in the database
with the given monikerMethod Detail |
---|
public static Room create(String roomName, AbstractZone zone)
Creates only temporary/anonymous rooms without referring to the database.
roomName
- the moniker of the roomzone
- the zone in which the room is to be created
create(String, AbstractZone, boolean)
public static Room create(String roomName, AbstractZone abstractZone, boolean mustExist) throws NotFoundException
roomName
- WRITEMEabstractZone
- WRITEMEmustExist
- If true, a named room from the database. If
false, an anonymous/temporary room.
NotFoundException
- Room moniker not foundpublic static AbstractRoom[] getAllRooms()
public static Room getByMoniker(String moniker, Zone zone)
moniker
- the moniker value for this roomzone
- the zone containing this room
private static int getNextID()
public void add(GameEvent game)
add
in interface AbstractRoom
game
- WRITEMEAbstractRoom.add(org.starhope.appius.game.GameEvent)
public int compareTo(AbstractRoom other)
compareTo
in interface Comparable<AbstractRoom>
Comparable.compareTo(Object)
public boolean contains(AbstractUser thing)
contains
in interface AbstractRoom
thing
- who
AbstractRoom.contains(org.starhope.appius.user.AbstractUser)
public void deleteVariable(String string)
deleteVariable
in interface AbstractRoom
deleteVariable
in interface HasVariables
string
- WRITEMEAbstractRoom.deleteVariable(java.lang.String)
public void destroySelf()
destroySelf
in interface AbstractRoom
AbstractRoom.destroySelf()
public boolean equals(AbstractRoom other)
other
- the other room to which this one will be compared
Object.equals(Object)
public boolean equals(Object other)
equals
in class Object
org.starhope.appius.game.AbstractRoom#equals(java.lang.Object)
public void flush()
flush
in interface AbstractRoom
flush
in class SQLPeerDatum
AbstractRoom.flush()
public void fromJSON(org.json.JSONObject jso) throws org.json.JSONException
fromJSON
in interface AbstractRoom
jso
- Serialized form
org.json.JSONException
- if the incoming data isn't in the right
formAbstractRoom.fromJSON(org.json.JSONObject)
public Set<RoomListener> getAllListeners()
getAllListeners
in interface AbstractRoom
AbstractRoom.getAllListeners()
public Collection<AbstractUser> getAllUsers()
getAllUsers
in interface AbstractRoom
AbstractRoom.getAllUsers()
private HashMap<String,String> getArbitraryVars()
protected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
public String getDebugName()
getDebugName
in interface AbstractRoom
AbstractRoom.getDebugName()
private Set<AbstractUser> getEverythingInRoom()
private void getFairground() throws SQLException
SQLException
- WRITEMEpublic String getFilename()
getFilename
in interface AbstractRoom
AbstractRoom.getFilename()
public GameEvent getGameEvent()
getGameEvent
in interface AbstractRoom
AbstractRoom.getGameEvent()
@Deprecated public int getId()
getId
in interface AbstractRoom
AbstractRoom.getId()
public int getID()
getID
in interface AbstractRoom
AbstractRoom.getID()
public Collection<RoomListener> getListeners()
getListeners
in interface AbstractRoom
AbstractRoom.getListeners()
public int getMaxUsers()
getMaxUsers
in interface AbstractRoom
AbstractRoom.getMaxUsers()
public String getMoniker()
getMoniker
in interface AbstractRoom
AbstractRoom.getMoniker()
private void getMovie() throws SQLException
SQLException
- WRITEMEpublic String getMusic()
getMusic
in interface AbstractRoom
AbstractRoom.getMusic()
public String getName()
getName
in interface AbstractRoom
AbstractRoom.getName()
public String getOverlay()
getOverlay
in interface AbstractRoom
AbstractRoom.getOverlay()
public AbstractUser getOwner()
getOwner
in interface AbstractRoom
AbstractRoom.getOwner()
public int getRoomIndex()
AbstractRoom
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.
getRoomIndex
in interface AbstractRoom
AbstractRoom.getRoomIndex()
private String getRoomJoinSFSXML(User user)
user
- WRITEME
public String getSky()
getSky
in interface AbstractRoom
AbstractRoom.getSky()
@Deprecated public org.json.JSONObject getSuperTootBots(int padding) throws SQLException, org.json.JSONException
padding
- WRITEME
SQLException
- WRITEME
org.json.JSONException
- WRITEME@Deprecated private org.json.JSONObject getSuperTootBots_JSON()
public String getTitle()
getTitle
in interface AbstractRoom
AbstractRoom.getTitle()
public int getUserCount()
getUserCount
in interface AbstractRoom
AbstractRoom.getUserCount()
public String getVariable(String string)
getVariable
in interface AbstractRoom
getVariable
in interface HasVariables
string
- WRITEME
AbstractRoom.getVariable(java.lang.String)
public HashMap<String,String> getVariables()
getVariables
in interface AbstractRoom
AbstractRoom.getVariables()
public AbstractZone getZone()
getZone
in interface AbstractRoom
AbstractRoom.getZone()
public int hashCode()
hashCode
in interface AbstractRoom
hashCode
in class Object
AbstractRoom.hashCode()
public boolean isLimbo()
isLimbo
in interface AbstractRoom
AbstractRoom.isLimbo()
public boolean isSkyVisible()
isSkyVisible
in interface AbstractRoom
AbstractRoom.isSkyVisible()
public void join(RoomListener thing)
join
in interface AbstractRoom
thing
- the thing that has joined the roomAbstractRoom.join(org.starhope.appius.game.RoomListener)
public void part(RoomListener thing)
part
in interface AbstractRoom
thing
- the thing which wants to stop listening to the roomAbstractRoom.part(RoomListener)
public void sendGameAction(User from, org.json.JSONObject data) throws org.json.JSONException
sendGameAction
in interface AbstractRoom
from
- WRITEMEdata
- WRITEME
org.json.JSONException
- if the action can't be represented in JSONAbstractRoom.sendGameAction(org.starhope.appius.user.User,
org.json.JSONObject)
public void sendPublicMessage(AbstractUser from, String speech)
sendPublicMessage
in interface AbstractRoom
from
- WRITEMEspeech
- WRITEMEAbstractRoom.sendPublicMessage(org.starhope.appius.user.AbstractUser,
java.lang.String)
protected void set(ResultSet rs) throws SQLException
set
in class SQLPeerDatum
rs
- The result of an SQL query, with the cursor already
pointed at the row describing this specific instance
of the object.
SQLException
- if the database fails somehowSQLPeerDatum.set(java.sql.ResultSet)
public void setFilename(String filename1)
setFilename
in interface AbstractRoom
filename1
- the filename to setAbstractRoom.setFilename(java.lang.String)
public void setLimbo(boolean b)
setLimbo
in interface AbstractRoom
b
- true, if this is a limbo roomAbstractRoom.setLimbo(boolean)
public void setMoniker(String moniker1)
setMoniker
in interface AbstractRoom
moniker1
- the moniker to setAbstractRoom.setMoniker(java.lang.String)
public void setMusic(String music1)
setMusic
in interface AbstractRoom
music1
- the new background musicAbstractRoom.setMusic(java.lang.String)
public void setOverlay(String overlay1)
setOverlay
in interface AbstractRoom
overlay1
- the overlay to setAbstractRoom.setOverlay(java.lang.String)
public void setOwner(AbstractUser newHomeOwner)
AbstractRoom
setOwner
in interface AbstractRoom
newHomeOwner
- the new owner of the home containing this
room. May be null.public void setRoomIndex(int newRoomIndex)
newRoomIndex
- the new room index within the user's housepublic void setRoomVars()
setRoomVars
in interface AbstractRoom
AbstractRoom.setRoomVars()
public void setSky(String sky1)
setSky
in interface AbstractRoom
sky1
- the sky to setAbstractRoom.setSky(java.lang.String)
public void setSkyVisible(boolean skyVisible1)
setSkyVisible
in interface AbstractRoom
skyVisible1
- the skyVisible to setAbstractRoom.setSkyVisible(boolean)
public void setTitle(String newTitle)
setTitle
in interface AbstractRoom
newTitle
- WRITEMEAbstractRoom.setTitle(java.lang.String)
public void setVariable(Map.Entry<String,String> var)
setVariable
in interface AbstractRoom
setVariable
in interface HasVariables
var
- A Hash type Entry object containing a key-value pair
to be used to set a variable.AbstractRoom.setVariable(java.util.Map.Entry)
public void setVariable(String varName, String varValue)
setVariable
in interface AbstractRoom
setVariable
in interface HasVariables
varName
- WRITEMEvarValue
- WRITEMEAbstractRoom.setVariable(java.lang.String,
java.lang.String)
public void setVariables(Map<String,String> map)
setVariables
in interface AbstractRoom
setVariables
in interface HasVariables
map
- WRITEMEAbstractRoom.setVariables(java.util.Map)
private void superbot_fetchBasicInfo(ResultSet rs, ResultSet botGot, org.json.JSONObject bot, org.json.JSONObject speech, org.json.JSONObject avatar) throws org.json.JSONException, SQLException
rs
- WRITEMEbotGot
- WRITEMEbot
- WRITEMEspeech
- WRITEMEavatar
- WRITEME
org.json.JSONException
- WRITEME
SQLException
- WRITEMEprivate void superbot_fetchClothing(ResultSet rs, org.json.JSONObject clothes) throws org.json.JSONException, SQLException
rs
- WRITEMEclothes
- WRITEME
org.json.JSONException
- WRITEME
SQLException
- WRITEMEprivate void superbot_fetchPattern(ResultSet rs, org.json.JSONObject clothes) throws org.json.JSONException, SQLException
rs
- WRITEMEclothes
- WRITEME
org.json.JSONException
- WRITEME
SQLException
- WRITEMEprivate org.json.JSONObject superbot_fetchSpeech(PreparedStatement getSpeech, ResultSet rs) throws SQLException, org.json.JSONException
getSpeech
- WRITEMErs
- WRITEME
SQLException
- WRITEME
org.json.JSONException
- WRITEMEpublic org.json.JSONObject toJSON()
toJSON
in interface AbstractRoom
toJSON
in class SQLPeerDatum
AbstractRoom.toJSON()
private void validateUserList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |