org.starhope.appius.via
Class ExistsInRemoteWorld

java.lang.Object
  extended by org.starhope.appius.via.RemoteUser
All Implemented Interfaces:
RoomListener, CastsToJSON, ExistsInWorld, ViaMunita<User>

public class ExistsInRemoteWorld
extends Object
implements ExistsInWorld, ViaMunita<User>

TODO: The documentation for this type (ExistsInRemoteWorld) is incomplete. (brpocock, Nov 5, 2009)

Author:
brpocock

Field Summary
private static long serialVersionUID
          TODO: document this field (brpocock, Nov 5, 2009) serialVersionUID (long)
 
Constructor Summary
ExistsInRemoteWorld()
           
 
Method Summary
 void acceptAdminMessage(Integer room, String string)
          This is an overriding method.
 void acceptAdminMessage(Room room, String string)
          This is an overriding method.
 void acceptGameAction(User sender, org.json.JSONObject action)
          Broadcast message of a game action taking place
 void acceptGameStateChange(GameEvent gameCode, GameStateFlag gameState)
          Notification of a GameEvent changing state for the room
 void acceptObjectJoinRoom(Room room, ExistsInWorld object)
          Notification that someone has entered the room.
 void acceptObjectPartRoom(Room room, ExistsInWorld object)
          Notification that someone has left a room
 void acceptOutOfBandMessage(ExistsInWorld sender, Room room, org.json.JSONObject body)
          Accept an out-of-band communications packet that was broadcast to a room in which this Listener is listening.
 void acceptPublicMessage(ExistsInWorld sender, Room room, String message)
          This is an overriding method.
 void acceptPublicMessage(ExistsInWorld sender, String message)
          This is an overriding method.
 String getAvatarLabel()
          The avatar label is the text block that is displayed with the avatar for this object.
 String getFacing()
          Get the string identifying the direction which this object is facing.
 RoomAndZone getLocation()
          TODO: document this method (brpocock, Oct 31, 2009)
 org.json.JSONObject getPublicInfo()
          TODO: document this method (brpocock, Oct 31, 2009) avatar, userName, clothes, colors
 Room getRoom()
          TODO: document this method (brpocock, Oct 31, 2009)
 double getTargetX()
          TODO: document this method (brpocock, Oct 31, 2009)
 double getTargetY()
          TODO: document this method (brpocock, Oct 31, 2009)
 double getTravelRate()
          This is an overriding method.
 long getTravelStart()
          This is an overriding method.
 int getUserID()
          TODO: document this method (brpocock, Oct 31, 2009)
 String getVariable(String string)
          TODO: document this method (brpocock, Oct 31, 2009)
 double getX()
          TODO: document this method (brpocock, Oct 31, 2009)
 double getY()
          TODO: document this method (brpocock, Oct 31, 2009)
 AbstractZone getZone()
          TODO: document this method (brpocock, Oct 31, 2009)
 boolean hasVariable(String string)
          This is an overriding method.
 boolean isNPC()
          TODO: document this method (brpocock, Oct 31, 2009)
 boolean isOnline()
          TODO: document this method (brpocock, Oct 31, 2009)
 void set(org.json.JSONObject o)
          This method will attempt to set the data contents of this object to the values derived from the JSON object being passed-in.
 void setStartT(long when)
          This is an overriding method.
 void setTravelRate(double rate)
          This is an overriding method.
 void setX(double x2)
          This is an overriding method.
 void setY(double y2)
          This is an overriding method.
 org.json.JSONObject toJSON()
          This returns a copy of the object's data cast into a JSON form.
 String toSFSXML()
          TODO: document this method (brpocock, Oct 31, 2009)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
TODO: document this field (brpocock, Nov 5, 2009) serialVersionUID (long)

See Also:
Constant Field Values
Constructor Detail

ExistsInRemoteWorld

public ExistsInRemoteWorld()
Method Detail

acceptAdminMessage

public void acceptAdminMessage(Integer room,
                               String string)
This is an overriding method.

Specified by:
acceptAdminMessage in interface ExistsInWorld
Parameters:
room - The room in which the administrative message is being sent (often ignored)
string - The administrative message.
See Also:
ExistsInWorld.acceptAdminMessage(java.lang.Integer, java.lang.String)

acceptAdminMessage

public void acceptAdminMessage(Room room,
                               String string)
This is an overriding method.

Specified by:
acceptAdminMessage in interface ExistsInWorld
Parameters:
room - The room in which the administrative message is being sent (often ignored)
string - The administrative message.
See Also:
ExistsInWorld.acceptAdminMessage(org.starhope.appius.game.Room, java.lang.String)

acceptGameAction

public void acceptGameAction(User sender,
                             org.json.JSONObject action)
Description copied from interface: RoomListener
Broadcast message of a game action taking place

Specified by:
acceptGameAction in interface RoomListener
Parameters:
sender - the sender
action - The game action. The verb is in action.getString("action").
See Also:
RoomListener.acceptGameAction(org.starhope.appius.user.User, org.json.JSONObject)

acceptGameStateChange

public void acceptGameStateChange(GameEvent gameCode,
                                  GameStateFlag gameState)
Description copied from interface: RoomListener
Notification of a GameEvent changing state for the room

Specified by:
acceptGameStateChange in interface RoomListener
Parameters:
gameCode - The GameEvent whose state is changing
gameState - The new state
See Also:
RoomListener.acceptGameStateChange(org.starhope.appius.game.GameEvent, org.starhope.appius.game.GameStateFlag)

acceptObjectJoinRoom

public void acceptObjectJoinRoom(Room room,
                                 ExistsInWorld object)
Description copied from interface: RoomListener
Notification that someone has entered the room.

Specified by:
acceptObjectJoinRoom in interface RoomListener
Parameters:
room - The room
object - The thing (probably user) entering
See Also:
RoomListener.acceptObjectJoinRoom(org.starhope.appius.game.Room, org.starhope.appius.util.AbstractUser)

acceptObjectPartRoom

public void acceptObjectPartRoom(Room room,
                                 ExistsInWorld object)
Description copied from interface: RoomListener
Notification that someone has left a room

Specified by:
acceptObjectPartRoom in interface RoomListener
Parameters:
room - The room
object - The thing (probably user) departing
See Also:
RoomListener.acceptObjectPartRoom(org.starhope.appius.game.Room, org.starhope.appius.util.AbstractUser)

acceptOutOfBandMessage

public void acceptOutOfBandMessage(ExistsInWorld sender,
                                   Room room,
                                   org.json.JSONObject body)
Description copied from interface: RoomListener
Accept an out-of-band communications packet that was broadcast to a room in which this Listener is listening.

Specified by:
acceptOutOfBandMessage in interface RoomListener
Parameters:
sender - The sender of the OOB message
room - The room in which the OOB message is being broadcast
body - A JSON object containing the OOB message. The contents of this message are not constrained.
See Also:
RoomListener.acceptOutOfBandMessage(org.starhope.appius.util.AbstractUser, org.starhope.appius.game.Room, org.json.JSONObject)

acceptPublicMessage

public void acceptPublicMessage(ExistsInWorld sender,
                                Room room,
                                String message)
This is an overriding method.

Specified by:
acceptPublicMessage in interface RoomListener
Parameters:
sender - The speaker
room - The room in which the words were spoken
message - The spoken text or /emote
See Also:
RoomListener.acceptPublicMessage(org.starhope.appius.util.AbstractUser, org.starhope.appius.game.Room, java.lang.String)

acceptPublicMessage

public void acceptPublicMessage(ExistsInWorld sender,
                                String message)
This is an overriding method.

Specified by:
acceptPublicMessage in interface RoomListener
Parameters:
sender - The speaker
message - The spoken text or /emote
See Also:
RoomListener.acceptPublicMessage(org.starhope.appius.util.AbstractUser, java.lang.String)

getAvatarLabel

public String getAvatarLabel()
Description copied from interface: ExistsInWorld
The avatar label is the text block that is displayed with the avatar for this object. It should be unique but isn't guaranteed to be distinct as user names are. (At any given moment, there can be only one object with a given avatar label in the room, but there can be only one user with a given name in the multiverse.) For users, this is the user name.

Specified by:
getAvatarLabel in interface ExistsInWorld
Returns:
The avatar label
See Also:
ExistsInWorld.getAvatarLabel()

getFacing

public String getFacing()
Description copied from interface: ExistsInWorld
Get the string identifying the direction which this object is facing. One of: N,S,E,W,NE,NW,SW,SE.

Specified by:
getFacing in interface ExistsInWorld
Returns:
The facing direction of this object
See Also:
ExistsInWorld.getFacing()

getLocation

public RoomAndZone getLocation()
Description copied from interface: RoomListener
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getLocation in interface RoomListener
Returns:
WRITEME
See Also:
RoomListener.getLocation()

getPublicInfo

public org.json.JSONObject getPublicInfo()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009) avatar, userName, clothes, colors

Specified by:
getPublicInfo in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.getPublicInfo()

getRoom

public Room getRoom()
Description copied from interface: RoomListener
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getRoom in interface RoomListener
Returns:
the Room in which this NPC can be found. This can be null.
See Also:
RoomListener.getRoom()

getTargetX

public double getTargetX()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getTargetX in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.getTargetX()

getTargetY

public double getTargetY()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getTargetY in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.getTargetY()

getTravelRate

public double getTravelRate()
This is an overriding method.

Specified by:
getTravelRate in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.getTravelRate()

getTravelStart

public long getTravelStart()
This is an overriding method.

Specified by:
getTravelStart in interface ExistsInWorld
Returns:
the time at which the object started moving (msec since epoch)
See Also:
ExistsInWorld.getTravelStart()

getUserID

public int getUserID()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getUserID in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.getUserID()

getVariable

public String getVariable(String string)
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getVariable in interface ExistsInWorld
Parameters:
string - WRITEME
Returns:
WRITEME
See Also:
ExistsInWorld.getVariable(java.lang.String)

getX

public double getX()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getX in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.getX()

getY

public double getY()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getY in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.getY()

getZone

public AbstractZone getZone()
Description copied from interface: RoomListener
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
getZone in interface RoomListener
Returns:
the Zone in which this NPC can be found
See Also:
RoomListener.getZone()

hasVariable

public boolean hasVariable(String string)
This is an overriding method.

Specified by:
hasVariable in interface ExistsInWorld
Parameters:
string - WRITEME
Returns:
WRITEME
See Also:
ExistsInWorld.hasVariable(java.lang.String)

isNPC

public boolean isNPC()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
isNPC in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.isNPC()

isOnline

public boolean isOnline()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
isOnline in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.isOnline()

set

public void set(org.json.JSONObject o)
Description copied from interface: CastsToJSON
This method will attempt to set the data contents of this object to the values derived from the JSON object being passed-in. All exceptions are ignored, but any errors in the JSON data could cause the command to fail, completely or partially.

Specified by:
set in interface CastsToJSON
Parameters:
o - The JSON object containing a the new data for this object.
See Also:
CastsToJSON.set(org.json.JSONObject)

setStartT

public void setStartT(long when)
This is an overriding method.

Specified by:
setStartT in interface ExistsInWorld
Parameters:
when - WRITEME
See Also:
ExistsInWorld.setStartT(long)

setTravelRate

public void setTravelRate(double rate)
This is an overriding method.

Specified by:
setTravelRate in interface ExistsInWorld
Parameters:
rate - WRITEME
See Also:
ExistsInWorld.setTravelRate(double)

setX

public void setX(double x2)
This is an overriding method.

Specified by:
setX in interface ExistsInWorld
Parameters:
x2 - WRITEME
See Also:
ExistsInWorld.setX(double)

setY

public void setY(double y2)
This is an overriding method.

Specified by:
setY in interface ExistsInWorld
Parameters:
y2 - WRITEME
See Also:
ExistsInWorld.setY(double)

toJSON

public org.json.JSONObject toJSON()
Description copied from interface: CastsToJSON
This returns a copy of the object's data cast into a JSON form.

Specified by:
toJSON in interface CastsToJSON
Returns:
The string representing this object in JSON format
See Also:
CastsToJSON.toJSON()

toSFSXML

public String toSFSXML()
Description copied from interface: ExistsInWorld
TODO: document this method (brpocock, Oct 31, 2009)

Specified by:
toSFSXML in interface ExistsInWorld
Returns:
WRITEME
See Also:
ExistsInWorld.toSFSXML()