org.starhope.appius.game.npc
Class GenericNPC

java.lang.Object
  extended by org.starhope.appius.user.GeneralUser
      extended by org.starhope.appius.user.AbstractNonPlayerCharacter
          extended by org.starhope.appius.game.npc.GenericNPC
All Implemented Interfaces:
Comparable<AbstractUser>, RoomListener, Collidable, HasVariables, AbstractUser, DataRecordBacked<UserRecord>, AcceptsMetronomeTicks, HasName

public class GenericNPC
extends AbstractNonPlayerCharacter

WRITEME: The documentation for this type (GenericNPC) is incomplete. (brpocock@star-hope.org, Feb 17, 2010)

Author:
brpocock@star-hope.org

Field Summary
protected  AbstractRoom currentRoom
          The room in which the NPC is standing
private  String facing
          the direction of facing
private  long nextOperationTime
          The time at which to perform another operation
(package private) static double octant
          The width of one octant (demi-quadrant) of a circle, for facing computations
(package private)  String[] octantFacing
          the string values of facings in each of the eight octants of a circle (and a repeat of #1 for padding's sake)
private  long startT
           
private  double targetX
          The target of the current travel
private  double targetY
          The target of the current travel
private  long travelStarted
          The time at which the user started traveling
private  double x
          WRITEME
private  double y
          WRITEME
 
Fields inherited from class org.starhope.appius.user.AbstractNonPlayerCharacter
instanceID
 
Fields inherited from class org.starhope.appius.user.GeneralUser
collisionBounds, userRecord
 
Constructor Summary
GenericNPC(int userID)
          WRITEME: Document this constructor brpocock@star-hope.org
 
Method Summary
 void acceptErrorReply(String command, String error, org.json.JSONObject result, AbstractRoom userCurrentRoomInZone)
          This is an overriding method.
 void acceptGameAction(AbstractUser u, org.json.JSONObject action)
          This is an overriding method.
 void acceptGameStateChange(GameEvent gameCode, GameStateFlag gameState)
          This is an overriding method.
 void acceptMessage(String title, String label, String content)
          This is an overriding method.
 void acceptObjectJoinRoom(AbstractRoom room, RoomListener object)
          This is an overriding method.
 void acceptObjectPartRoom(AbstractRoom room, RoomListener thing)
          This is an overriding method.
 void acceptOutOfBandMessage(AbstractUser sender, AbstractRoom room, org.json.JSONObject body)
          This is an overriding method.
 void acceptPublicMessage(AbstractUser sender, AbstractRoom room, String message)
          This is an overriding method.
 void acceptPublicMessage(AbstractUser from, String message)
          This is an overriding method.
 void acceptSuccessReply(String command, org.json.JSONObject jsonData, AbstractRoom room)
          This is an overriding method.
 void acceptUserVariableUpdate(AbstractUser user, String varName, String varValue)
          This is an overriding method.
 void addBuddy(AbstractUser buddy)
          This is an overriding method.
 void addGiftSubscription(int i, int days)
          This is an overriding method.
 void addItem(int parseInt)
          This is an overriding method.
 void assertStaffLevel(int staffLevelStaffMember)
          This is an overriding method.
 void attend(AbstractUser byLogin)
          This is an overriding method.
 void ban(AbstractUser u, String banReason)
          This is an overriding method.
 boolean canTalk()
          This is an overriding method.
 void doAfter(double seconds, FutureActionVerb action, Object... args)
          Do something in the future, appending the script to the end of the queue
 void doffClothes()
          This is an overriding method.
 void doTransport()
          This is an overriding method.
private  double findCurrentPos(double fromX, double toX, AbstractUser them)
          Figure out the current X or Y position of a moving avatar
private  String findFacingTo(AbstractUser them)
          WRITEME: document this method (brpocock@star-hope.org, Feb 17, 2010)
 int getAge()
          This is an overriding method.
 AgeBracket getAgeGroup()
          This is an overriding method.
 String getApprovedDateString()
          This is an overriding method.
 AvatarClass getAvatarClass()
          This is an overriding method.
 String getAvatarLabel()
          This is an overriding method.
private  String getAvatarNick(AbstractUser them)
          WRITEME: document this method (brpocock@star-hope.org, Feb 17, 2010)
 Collection<String> getBuddyListNames()
          This is an overriding method.
 String getDebugName()
          This is an overriding method.
 String getDialect()
          This is an overriding method.
 String getDisplayName()
          This is an overriding method.
 String getFacing()
          This is an overriding method.
protected  int getInstanceID()
           
 Inventory getInventory()
          This is an overriding method.
 String getIPAddress()
          This is an overriding method.
 int getKickedByUserID()
          This is an overriding method.
 String getKickedMessage()
          This is an overriding method.
 String getKickedReasonCode()
          This is an overriding method.
 Timestamp getKickedUntil()
          This is an overriding method.
 long getLag()
           
 String getLanguage()
          This is an overriding method.
 String getMail()
          This is an overriding method.
 BigDecimal getMoney(Currency currency)
          To be deprecated in favour of AbstractUser.getWallet() ASAP!
 String getName()
          This is an overriding method.
 Date getNameApprovedAt()
          This is an overriding method.
 Date getNameRequestedAt()
          This is an overriding method.
 long getNextOperationTime()
           
 org.json.JSONObject getPublicInfo()
          This is an overriding method.
 String getRegisteredDateString()
          This is an overriding method.
 String getResponsibleMail()
          This is an overriding method.
 AbstractRoom getRoom()
          This is an overriding method.
 int getRoomNumber()
          This is an overriding method.
 ServerThread getServerThread()
          This is an overriding method.
 int getStaffLevel()
          This is an overriding method.
 long getStartT()
           
 double getTravelRate()
          This is an overriding method.
 long getTravelStart()
          This is an overriding method.
 int getUserID()
          This is an overriding method.
 Map<String,String> getUserVariables()
          This is an overriding method.
 String getVariable(String string)
          This is an overriding method.
 AbstractZone getZone()
          This is an overriding method.
 boolean hasStaffLevel(int i)
          Deprecated. use Security.hasCapability(AbstractUser, org.starhope.appius.sys.admin.SecurityCapability)
 boolean hasVariable(String string)
          This is an overriding method.
 void ignore(AbstractUser byLogin)
          This is an overriding method.
 boolean isBanned()
          This is an overriding method.
 boolean isCanceled()
          This is an overriding method.
 boolean isKicked()
          This is an overriding method.
 boolean isOnline()
          This is an overriding method.
 boolean isPaidMember()
          This is an overriding method.
 void kick(AbstractUser u, String kickReason, int duration)
          This is an overriding method.
 void liftBan(AbstractUser authority)
          This is an overriding method.
 boolean needsParent()
          This is an overriding method.
 void parentApprovedAccount(boolean b)
          This is an overriding method.
 void removeBuddy(AbstractUser byLogin)
          This is an overriding method.
 void reportedToModeratorBy(AbstractUser u)
          This is an overriding method.
 void reportedToModeratorBy(AbstractUser u, String reason)
          This is an overriding method.
 void sendEarnings(AbstractRoom room, String string)
          This is an overriding method.
 void sendMigrate(AbstractZone refugeeZone)
          This is an overriding method.
 void sendOops()
          This is an overriding method.
 void sendResponse(org.json.JSONObject result)
          This is an overriding method.
 void sendUserLists()
          This is an overriding method.
 void sendWardrobe()
          This is an overriding method.
 void setAgeGroupToSystem()
          This is an overriding method.
 void setBaseColor(Colour colour)
          This is an overriding method.
 void setCanTalk(boolean b)
          This is an overriding method.
 void setExtraColor(Colour colour)
          This is an overriding method.
 void setFacing()
          WRITEME
 void setLastActive()
          This is an overriding method.
 void setMail(String email)
          This is an overriding method.
 void setNextOperationTime(long nextOperationTime1)
           
 void setParent(Parent newParent)
          This is an overriding method.
 int setRoom(AbstractRoom room)
          This is an overriding method.
 void setStartT(long when)
          This is an overriding method.
 void setTravelRate(double rate)
          This is an overriding method.
 void setTravelStart(long l)
          WRITEME: Document this method brpocock@star-hope.org
 void setVariable(String varName, String varValue)
          This is an overriding method.
 void speak(AbstractRoom room, String string)
          This is an overriding method.
 void tick(long currentTime, long deltaTime)
          This is an overriding method.
 org.json.JSONObject toJSON()
          This is an overriding method.
 String toSFSXML()
          This is an overriding method.
private  void updatePos()
          WRITEME: document this method (brpocock@star-hope.org, Feb 17, 2010)
 
Methods inherited from class org.starhope.appius.user.AbstractNonPlayerCharacter
acceptPrivateMessage, compareTo, destroy, getBaseColor, getGreeting, getLocation, getNameStripped, getPublicInfo_new, getTarget, getWallet, isNPC, setFacing, setLocation, setTarget
 
Methods inherited from class org.starhope.appius.user.GeneralUser
assertLocationUnlocked, canApproveSelf, canBetaTest, canEnterChatZone, canEnterMenuZone, deleteVariable, getCenterOfMass, getCollisionBounds, getCurrentAction, getEndMovementTime, getExtraColor, getGameEquipItems_JSON, getGameEquipItems, getHeight, getHouse, getIgnoreList, getItemsByType, getItemsByType, getItemsByTypeAsArray, getLocationForUpdate, getMass, getRegisteredAt, getRegisteredDate, getRequestedName, getSizeScalar, getStartMovementTime, getUserName, getVariables, getVariablesJSON, getVelocity, isActive, isApproved, local_publicInfo, setCenterOfMass, setCurrentAction, setVariable, setVariables, setVelocity, unlockLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentRoom

protected final AbstractRoom currentRoom
The room in which the NPC is standing


facing

private String facing
the direction of facing


nextOperationTime

private long nextOperationTime
The time at which to perform another operation


octant

static final double octant
The width of one octant (demi-quadrant) of a circle, for facing computations


octantFacing

final String[] octantFacing
the string values of facings in each of the eight octants of a circle (and a repeat of #1 for padding's sake)


targetX

private final double targetX
The target of the current travel

See Also:
Constant Field Values

targetY

private final double targetY
The target of the current travel

See Also:
Constant Field Values

travelStarted

private long travelStarted
The time at which the user started traveling


x

private double x
WRITEME


y

private double y
WRITEME


startT

private long startT
Constructor Detail

GenericNPC

public GenericNPC(int userID)
           throws NotFoundException,
                  GameLogicException
WRITEME: Document this constructor brpocock@star-hope.org

Parameters:
userID - the user ID of the user record for this NPC
Throws:
NotFoundException - if the user ID isn't found or isn't an NPC
GameLogicException - WRITEME
Method Detail

acceptErrorReply

public void acceptErrorReply(String command,
                             String error,
                             org.json.JSONObject result,
                             AbstractRoom userCurrentRoomInZone)
This is an overriding method.

Specified by:
acceptErrorReply in interface AbstractUser
Overrides:
acceptErrorReply in class AbstractNonPlayerCharacter
Parameters:
command - The command which produced the error
error - The error code
result - The additional JSON data describing the error
userCurrentRoomInZone - The room in which the user was standing when the error occurred.
See Also:
AbstractUser.acceptErrorReply(java.lang.String, java.lang.String, org.json.JSONObject, org.starhope.appius.game.AbstractRoom)

acceptGameAction

public void acceptGameAction(AbstractUser u,
                             org.json.JSONObject action)
This is an overriding method.

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

acceptGameStateChange

public void acceptGameStateChange(GameEvent gameCode,
                                  GameStateFlag gameState)
This is an overriding method.

Specified by:
acceptGameStateChange in interface RoomListener
Overrides:
acceptGameStateChange in class AbstractNonPlayerCharacter
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)

acceptMessage

public void acceptMessage(String title,
                          String label,
                          String content)
This is an overriding method.

Specified by:
acceptMessage in interface AbstractUser
Overrides:
acceptMessage in class AbstractNonPlayerCharacter
Parameters:
title - The title of the message
label - A label which nominally identifies the source of the message
content - The contents of the message
See Also:
AbstractUser.acceptMessage(java.lang.String, java.lang.String, java.lang.String)

acceptObjectJoinRoom

public void acceptObjectJoinRoom(AbstractRoom room,
                                 RoomListener object)
This is an overriding method.

Parameters:
room - The room
object - The thing (probably user) entering
See Also:
RoomListener.acceptObjectJoinRoom(org.starhope.appius.game.AbstractRoom, org.starhope.appius.game.RoomListener)

acceptObjectPartRoom

public void acceptObjectPartRoom(AbstractRoom room,
                                 RoomListener thing)
This is an overriding method.

Parameters:
room - The room
thing - The thing (probably user) departing
See Also:
RoomListener.acceptObjectPartRoom(org.starhope.appius.game.AbstractRoom, org.starhope.appius.game.RoomListener)

acceptOutOfBandMessage

public void acceptOutOfBandMessage(AbstractUser sender,
                                   AbstractRoom room,
                                   org.json.JSONObject body)
This is an overriding method.

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.user.AbstractUser, org.starhope.appius.game.AbstractRoom, org.json.JSONObject)

acceptPublicMessage

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

Specified by:
acceptPublicMessage in interface RoomListener
Overrides:
acceptPublicMessage in class AbstractNonPlayerCharacter
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.user.AbstractUser, org.starhope.appius.game.AbstractRoom, java.lang.String)

acceptPublicMessage

public void acceptPublicMessage(AbstractUser from,
                                String message)
This is an overriding method.

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

acceptSuccessReply

public void acceptSuccessReply(String command,
                               org.json.JSONObject jsonData,
                               AbstractRoom room)
This is an overriding method.

Specified by:
acceptSuccessReply in interface AbstractUser
Overrides:
acceptSuccessReply in class AbstractNonPlayerCharacter
Parameters:
command - WRITEME
jsonData - WRITEME
room - WRITEME
See Also:
AbstractUser.acceptSuccessReply(java.lang.String, org.json.JSONObject, org.starhope.appius.game.AbstractRoom)

acceptUserVariableUpdate

public void acceptUserVariableUpdate(AbstractUser user,
                                     String varName,
                                     String varValue)
This is an overriding method.

Parameters:
user - The user updating their variable
varName - The name of the variable (key)
varValue - The new value (null if unset)
See Also:
RoomListener.acceptUserVariableUpdate(org.starhope.appius.user.AbstractUser, java.lang.String, java.lang.String)

addBuddy

public void addBuddy(AbstractUser buddy)
This is an overriding method.

Specified by:
addBuddy in interface AbstractUser
Overrides:
addBuddy in class AbstractNonPlayerCharacter
Parameters:
buddy - WRITEME
See Also:
AbstractUser.addBuddy(org.starhope.appius.user.AbstractUser)

addGiftSubscription

public void addGiftSubscription(int i,
                                int days)
This is an overriding method.

Specified by:
addGiftSubscription in interface AbstractUser
Overrides:
addGiftSubscription in class AbstractNonPlayerCharacter
Parameters:
i - WRITEME
days - WRITEME
See Also:
AbstractUser.addGiftSubscription(int, int)

addItem

public void addItem(int parseInt)
This is an overriding method.

Specified by:
addItem in interface AbstractUser
Overrides:
addItem in class AbstractNonPlayerCharacter
Parameters:
parseInt - the item ID to be instantiated and added
See Also:
AbstractUser.addItem(int)

assertStaffLevel

public void assertStaffLevel(int staffLevelStaffMember)
                      throws PrivilegeRequiredException
This is an overriding method.

Specified by:
assertStaffLevel in interface AbstractUser
Overrides:
assertStaffLevel in class AbstractNonPlayerCharacter
Parameters:
staffLevelStaffMember - The minimum staff level which is being asserted
Throws:
PrivilegeRequiredException - if the minimum staff level is not met.
See Also:
AbstractUser.assertStaffLevel(int)

attend

public void attend(AbstractUser byLogin)
This is an overriding method.

Specified by:
attend in interface AbstractUser
Overrides:
attend in class AbstractNonPlayerCharacter
Parameters:
byLogin - the user to whom to now attend
See Also:
AbstractUser.attend(org.starhope.appius.user.AbstractUser)

ban

public void ban(AbstractUser u,
                String banReason)
         throws PrivilegeRequiredException
This is an overriding method.

Parameters:
u - WRITEME
banReason - WRITEME
Throws:
PrivilegeRequiredException - WRITEME
See Also:
AbstractUser.ban(org.starhope.appius.user.AbstractUser, java.lang.String)

canTalk

public boolean canTalk()
This is an overriding method.

Specified by:
canTalk in interface AbstractUser
Overrides:
canTalk in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.canTalk()

doAfter

public void doAfter(double seconds,
                    FutureActionVerb action,
                    Object... args)
Do something in the future, appending the script to the end of the queue

Parameters:
seconds - The approximate number of seconds to delay
action - The type of action to be performed
args - Arguments specific to the type of action

doffClothes

public void doffClothes()
This is an overriding method.

Specified by:
doffClothes in interface AbstractUser
Overrides:
doffClothes in class AbstractNonPlayerCharacter
See Also:
AbstractUser.doffClothes()

doTransport

public void doTransport()
This is an overriding method.

Specified by:
doTransport in interface AbstractUser
Overrides:
doTransport in class AbstractNonPlayerCharacter
See Also:
AbstractUser.doTransport()

findCurrentPos

private double findCurrentPos(double fromX,
                              double toX,
                              AbstractUser them)
Figure out the current X or Y position of a moving avatar

Parameters:
fromX - the starting X or Y value
toX - the ending X or Y value
them - the moving avatar
Returns:
the current position along the line

findFacingTo

private String findFacingTo(AbstractUser them)
WRITEME: document this method (brpocock@star-hope.org, Feb 17, 2010)

Parameters:
them - WRITEME
Returns:
WRITEME

getAge

public int getAge()
This is an overriding method.

Specified by:
getAge in interface AbstractUser
Overrides:
getAge in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getAge()

getAgeGroup

public AgeBracket getAgeGroup()
This is an overriding method.

Specified by:
getAgeGroup in interface AbstractUser
Overrides:
getAgeGroup in class AbstractNonPlayerCharacter
Returns:
the age bracket of the user
See Also:
AbstractUser.getAgeGroup()

getApprovedDateString

public String getApprovedDateString()
This is an overriding method.

Specified by:
getApprovedDateString in interface AbstractUser
Overrides:
getApprovedDateString in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getApprovedDateString()

getAvatarClass

public AvatarClass getAvatarClass()
This is an overriding method.

Specified by:
getAvatarClass in interface AbstractUser
Overrides:
getAvatarClass in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getAvatarClass()

getAvatarLabel

public String getAvatarLabel()
This is an overriding method.

Specified by:
getAvatarLabel in interface AbstractUser
Overrides:
getAvatarLabel in class AbstractNonPlayerCharacter
Returns:
The avatar label
See Also:
AbstractUser.getAvatarLabel()

getAvatarNick

private String getAvatarNick(AbstractUser them)
WRITEME: document this method (brpocock@star-hope.org, Feb 17, 2010)

Parameters:
them - the user whose nickname is about to be shortened
Returns:
a brief version of the avatar's label

getBuddyListNames

public Collection<String> getBuddyListNames()
This is an overriding method.

Specified by:
getBuddyListNames in interface AbstractUser
Overrides:
getBuddyListNames in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getBuddyListNames()

getDebugName

public String getDebugName()
This is an overriding method.

Specified by:
getDebugName in interface AbstractUser
Overrides:
getDebugName in class AbstractNonPlayerCharacter
Returns:
A string with the user's login string and user ID number, formatted for debugging output
See Also:
AbstractUser.getDebugName()

getDialect

public String getDialect()
This is an overriding method.

Specified by:
getDialect in interface AbstractUser
Overrides:
getDialect in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getDialect()

getDisplayName

public String getDisplayName()
This is an overriding method.

Specified by:
getDisplayName in interface AbstractUser
Overrides:
getDisplayName in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getDisplayName()

getFacing

public String getFacing()
This is an overriding method.

Specified by:
getFacing in interface AbstractUser
Overrides:
getFacing in class GeneralUser
Returns:
The facing direction of this object
See Also:
AbstractUser.getFacing()

getInstanceID

protected int getInstanceID()
Specified by:
getInstanceID in class AbstractNonPlayerCharacter
Returns:
An unique ID for this instance of
See Also:
AbstractNonPlayerCharacter.getInstanceID()

getInventory

public Inventory getInventory()
This is an overriding method.

Specified by:
getInventory in interface AbstractUser
Overrides:
getInventory in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getInventory()

getIPAddress

public String getIPAddress()
This is an overriding method.

Specified by:
getIPAddress in interface AbstractUser
Overrides:
getIPAddress in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getIPAddress()

getKickedByUserID

public int getKickedByUserID()
This is an overriding method.

Specified by:
getKickedByUserID in interface AbstractUser
Overrides:
getKickedByUserID in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getKickedByUserID()

getKickedMessage

public String getKickedMessage()
This is an overriding method.

Specified by:
getKickedMessage in interface AbstractUser
Overrides:
getKickedMessage in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getKickedMessage()

getKickedReasonCode

public String getKickedReasonCode()
This is an overriding method.

Specified by:
getKickedReasonCode in interface AbstractUser
Overrides:
getKickedReasonCode in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getKickedReasonCode()

getKickedUntil

public Timestamp getKickedUntil()
This is an overriding method.

Specified by:
getKickedUntil in interface AbstractUser
Overrides:
getKickedUntil in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getKickedUntil()

getLag

public long getLag()
Specified by:
getLag in interface AbstractUser
Overrides:
getLag in class AbstractNonPlayerCharacter
Returns:
round-trip lag time
See Also:
AbstractUser.getLag()

getLanguage

public String getLanguage()
This is an overriding method.

Specified by:
getLanguage in interface AbstractUser
Overrides:
getLanguage in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getLanguage()

getMail

public String getMail()
This is an overriding method.

Specified by:
getMail in interface AbstractUser
Overrides:
getMail in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getMail()

getMoney

public BigDecimal getMoney(Currency currency)
Description copied from interface: AbstractUser
To be deprecated in favour of AbstractUser.getWallet() ASAP!

Specified by:
getMoney in interface AbstractUser
Overrides:
getMoney in class AbstractNonPlayerCharacter
Parameters:
currency - units
Returns:
amount
See Also:
AbstractUser.getMoney(org.starhope.appius.mb.Currency)

getName

public String getName()
This is an overriding method.

Specified by:
getName in interface HasName
Overrides:
getName in class AbstractNonPlayerCharacter
Returns:
a user-visible string name for this instance
See Also:
HasName.getName()

getNameApprovedAt

public Date getNameApprovedAt()
This is an overriding method.

Specified by:
getNameApprovedAt in interface AbstractUser
Overrides:
getNameApprovedAt in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getNameApprovedAt()

getNameRequestedAt

public Date getNameRequestedAt()
This is an overriding method.

Specified by:
getNameRequestedAt in interface AbstractUser
Overrides:
getNameRequestedAt in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getNameRequestedAt()

getNextOperationTime

public long getNextOperationTime()
Returns:
the nextOperationTime

getPublicInfo

public org.json.JSONObject getPublicInfo()
This is an overriding method.

Specified by:
getPublicInfo in interface AbstractUser
Overrides:
getPublicInfo in class GeneralUser
Returns:
JSONObject 'self' including userName and avatarClass
See Also:
AbstractUser.getPublicInfo()

getRegisteredDateString

public String getRegisteredDateString()
This is an overriding method.

Specified by:
getRegisteredDateString in interface AbstractUser
Overrides:
getRegisteredDateString in class AbstractNonPlayerCharacter
Returns:
Returns an user-visible string describing when the user was registered
See Also:
AbstractUser.getRegisteredDateString()

getResponsibleMail

public String getResponsibleMail()
This is an overriding method.

Specified by:
getResponsibleMail in interface AbstractUser
Overrides:
getResponsibleMail in class AbstractNonPlayerCharacter
Returns:
the eMail address
See Also:
AbstractUser.getResponsibleMail()

getRoom

public AbstractRoom getRoom()
This is an overriding method.

Specified by:
getRoom in interface RoomListener
Overrides:
getRoom in class GeneralUser
Returns:
The room in which the user currently exists. This might potentially be null.
See Also:
RoomListener.getRoom()

getRoomNumber

public int getRoomNumber()
This is an overriding method.

Specified by:
getRoomNumber in interface AbstractUser
Overrides:
getRoomNumber in class GeneralUser
Returns:
the number of the user's current room; or -1 if the user isn't in any room
See Also:
AbstractUser.getRoomNumber()

getServerThread

public ServerThread getServerThread()
This is an overriding method.

Specified by:
getServerThread in interface AbstractUser
Overrides:
getServerThread in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getServerThread()

getStaffLevel

public int getStaffLevel()
This is an overriding method.

Specified by:
getStaffLevel in interface AbstractUser
Overrides:
getStaffLevel in class AbstractNonPlayerCharacter
Returns:
the staffLevel
See Also:
AbstractUser.getStaffLevel()

getStartT

public long getStartT()
Specified by:
getStartT in interface AbstractUser
Overrides:
getStartT in class AbstractNonPlayerCharacter
Returns:
the time at which the user last actually started moving
See Also:
AbstractUser.getStartT()

getTravelRate

public double getTravelRate()
This is an overriding method.

Specified by:
getTravelRate in interface AbstractUser
Overrides:
getTravelRate in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getTravelRate()

getTravelStart

public long getTravelStart()
This is an overriding method.

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

getUserID

public int getUserID()
This is an overriding method.

Specified by:
getUserID in interface AbstractUser
Overrides:
getUserID in class AbstractNonPlayerCharacter
Returns:
the userID
See Also:
AbstractUser.getUserID()

getUserVariables

public Map<String,String> getUserVariables()
This is an overriding method.

Specified by:
getUserVariables in interface AbstractUser
Overrides:
getUserVariables in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.getUserVariables()

getVariable

public String getVariable(String string)
This is an overriding method.

Specified by:
getVariable in interface HasVariables
Specified by:
getVariable in interface AbstractUser
Overrides:
getVariable in class AbstractNonPlayerCharacter
Parameters:
string - Variable key
Returns:
Value of the named variable
See Also:
AbstractUser.getVariable(java.lang.String)

getZone

public AbstractZone getZone()
This is an overriding method.

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

hasStaffLevel

@Deprecated
public boolean hasStaffLevel(int i)
Deprecated. use Security.hasCapability(AbstractUser, org.starhope.appius.sys.admin.SecurityCapability)

This is an overriding method.

Specified by:
hasStaffLevel in interface AbstractUser
Overrides:
hasStaffLevel in class AbstractNonPlayerCharacter
Parameters:
i - The minimum staff level for which we are testing.
Returns:
True, if the user meets the minimum staff level stated; false, otherwise.
See Also:
AbstractUser.hasStaffLevel(int)

hasVariable

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

Specified by:
hasVariable in interface AbstractUser
Overrides:
hasVariable in class AbstractNonPlayerCharacter
Parameters:
string - WRITEME
Returns:
WRITEME
See Also:
AbstractUser.hasVariable(java.lang.String)

ignore

public void ignore(AbstractUser byLogin)
This is an overriding method.

Specified by:
ignore in interface AbstractUser
Overrides:
ignore in class AbstractNonPlayerCharacter
Parameters:
byLogin - The user, whom this user wishes to ignore
See Also:
AbstractUser.ignore(org.starhope.appius.user.AbstractUser)

isBanned

public boolean isBanned()
This is an overriding method.

Specified by:
isBanned in interface AbstractUser
Overrides:
isBanned in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.isBanned()

isCanceled

public boolean isCanceled()
This is an overriding method.

Specified by:
isCanceled in interface AbstractUser
Overrides:
isCanceled in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.isCanceled()

isKicked

public boolean isKicked()
This is an overriding method.

Specified by:
isKicked in interface AbstractUser
Overrides:
isKicked in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.isKicked()

isOnline

public boolean isOnline()
This is an overriding method.

Specified by:
isOnline in interface AbstractUser
Overrides:
isOnline in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.isOnline()

isPaidMember

public boolean isPaidMember()
This is an overriding method.

Specified by:
isPaidMember in interface AbstractUser
Overrides:
isPaidMember in class AbstractNonPlayerCharacter
Returns:
WRITEME
See Also:
AbstractUser.isPaidMember()

kick

public void kick(AbstractUser u,
                 String kickReason,
                 int duration)
          throws PrivilegeRequiredException
This is an overriding method.

Specified by:
kick in interface AbstractUser
Overrides:
kick in class AbstractNonPlayerCharacter
Parameters:
u - WRITEME
kickReason - WRITEME
duration - WRITEME
Throws:
PrivilegeRequiredException - WRITEME
See Also:
AbstractUser.kick(org.starhope.appius.user.AbstractUser, java.lang.String, int)

liftBan

public void liftBan(AbstractUser authority)
             throws PrivilegeRequiredException
This is an overriding method.

Specified by:
liftBan in interface AbstractUser
Overrides:
liftBan in class AbstractNonPlayerCharacter
Parameters:
authority - WRITEME
Throws:
PrivilegeRequiredException - WRITEME
See Also:
AbstractUser.liftBan(org.starhope.appius.user.AbstractUser)

needsParent

public boolean needsParent()
This is an overriding method.

Specified by:
needsParent in interface AbstractUser
Overrides:
needsParent in class AbstractNonPlayerCharacter
Returns:
true, if this is a kid account without a known parent (yet)
See Also:
AbstractUser.needsParent()

parentApprovedAccount

public void parentApprovedAccount(boolean b)
This is an overriding method.

Parameters:
b - WRITEME

removeBuddy

public void removeBuddy(AbstractUser byLogin)
This is an overriding method.

Specified by:
removeBuddy in interface AbstractUser
Overrides:
removeBuddy in class AbstractNonPlayerCharacter
Parameters:
byLogin - WRITEME
See Also:
AbstractUser.removeBuddy(org.starhope.appius.user.AbstractUser)

reportedToModeratorBy

public void reportedToModeratorBy(AbstractUser u)
This is an overriding method.

Specified by:
reportedToModeratorBy in interface AbstractUser
Overrides:
reportedToModeratorBy in class AbstractNonPlayerCharacter
Parameters:
u - WRITEME
See Also:
AbstractUser.reportedToModeratorBy(org.starhope.appius.user.AbstractUser)

reportedToModeratorBy

public void reportedToModeratorBy(AbstractUser u,
                                  String reason)
This is an overriding method.

Specified by:
reportedToModeratorBy in interface AbstractUser
Overrides:
reportedToModeratorBy in class AbstractNonPlayerCharacter
Parameters:
u - WRITEME
reason - WRITEME
See Also:
AbstractUser.reportedToModeratorBy(org.starhope.appius.user.AbstractUser, java.lang.String)

sendEarnings

public void sendEarnings(AbstractRoom room,
                         String string)
This is an overriding method.

Parameters:
room - WRITEME
string - WRITEME
See Also:
AbstractUser.sendEarnings(org.starhope.appius.game.AbstractRoom, java.lang.String)

sendMigrate

public void sendMigrate(AbstractZone refugeeZone)
                 throws UserDeadException
This is an overriding method.

Parameters:
refugeeZone - WRITEME
Throws:
UserDeadException - WRITEME
See Also:
AbstractUser.sendMigrate(org.starhope.appius.types.AbstractZone)

sendOops

public void sendOops()
This is an overriding method.

Specified by:
sendOops in interface AbstractUser
Overrides:
sendOops in class AbstractNonPlayerCharacter
See Also:
AbstractUser.sendOops()

sendResponse

public void sendResponse(org.json.JSONObject result)
This is an overriding method.

Specified by:
sendResponse in interface AbstractUser
Overrides:
sendResponse in class AbstractNonPlayerCharacter
Parameters:
result - WRITEME
See Also:
AbstractUser.sendResponse(org.json.JSONObject)

sendUserLists

public void sendUserLists()
This is an overriding method.

See Also:
AbstractUser.sendUserLists()

sendWardrobe

public void sendWardrobe()
This is an overriding method.

See Also:
AbstractUser.sendWardrobe()

setAgeGroupToSystem

public void setAgeGroupToSystem()
This is an overriding method.

Specified by:
setAgeGroupToSystem in interface AbstractUser
Overrides:
setAgeGroupToSystem in class GeneralUser
See Also:
AbstractUser.setAgeGroupToSystem()

setBaseColor

public void setBaseColor(Colour colour)
This is an overriding method.

Specified by:
setBaseColor in interface AbstractUser
Overrides:
setBaseColor in class GeneralUser
Parameters:
colour - WRITEME
See Also:
AbstractUser.setBaseColor(org.starhope.appius.types.Colour)

setCanTalk

public void setCanTalk(boolean b)
This is an overriding method.

Specified by:
setCanTalk in interface AbstractUser
Overrides:
setCanTalk in class GeneralUser
Parameters:
b - WRITEME
See Also:
AbstractUser.setCanTalk(boolean)

setExtraColor

public void setExtraColor(Colour colour)
This is an overriding method.

Specified by:
setExtraColor in interface AbstractUser
Overrides:
setExtraColor in class AbstractNonPlayerCharacter
Parameters:
colour - WRITEME
See Also:
AbstractUser.setExtraColor(org.starhope.appius.types.Colour)

setFacing

public void setFacing()
WRITEME


setLastActive

public void setLastActive()
This is an overriding method.

Specified by:
setLastActive in interface AbstractUser
Overrides:
setLastActive in class AbstractNonPlayerCharacter
See Also:
AbstractUser.setLastActive()

setMail

public void setMail(String email)
             throws GameLogicException
This is an overriding method.

Specified by:
setMail in interface AbstractUser
Overrides:
setMail in class AbstractNonPlayerCharacter
Parameters:
email - WRITEME
Throws:
GameLogicException - WRITEME
See Also:
AbstractUser.setMail(java.lang.String)

setNextOperationTime

public void setNextOperationTime(long nextOperationTime1)
Parameters:
nextOperationTime1 - the nextOperationTime to set

setParent

public void setParent(Parent newParent)
               throws GameLogicException,
                      ForbiddenUserException
This is an overriding method.

Specified by:
setParent in interface AbstractUser
Overrides:
setParent in class AbstractNonPlayerCharacter
Parameters:
newParent - the new parent record to associate with this user
Throws:
GameLogicException - if this user account does not need a parent record (adult account or system/robot account)
ForbiddenUserException - if the parent is not allowed to register/associate new child accounts (usually due to having other child accounts which are banned)
See Also:
AbstractUser.setParent(org.starhope.appius.user.Parent)

setRoom

public int setRoom(AbstractRoom room)
This is an overriding method.

Specified by:
setRoom in interface AbstractUser
Overrides:
setRoom in class AbstractNonPlayerCharacter
Parameters:
room - the room in which the user must exist
Returns:
the room number set
See Also:
AbstractUser.setRoom(org.starhope.appius.game.AbstractRoom)

setStartT

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

Specified by:
setStartT in interface AbstractUser
Overrides:
setStartT in class AbstractNonPlayerCharacter
Parameters:
when - the time at which the user last made a conscious change in their movement
See Also:
AbstractUser.setStartT(long)

setTravelRate

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

Specified by:
setTravelRate in interface AbstractUser
Overrides:
setTravelRate in class GeneralUser
Parameters:
rate - WRITEME
See Also:
AbstractUser.setTravelRate(double)

setTravelStart

public void setTravelStart(long l)
Description copied from interface: AbstractUser
WRITEME: Document this method brpocock@star-hope.org

Specified by:
setTravelStart in interface AbstractUser
Overrides:
setTravelStart in class AbstractNonPlayerCharacter
Parameters:
l - WRITEME
See Also:
AbstractUser.setTravelStart(long)

setVariable

public void setVariable(String varName,
                        String varValue)
This is an overriding method.

Specified by:
setVariable in interface HasVariables
Specified by:
setVariable in interface AbstractUser
Overrides:
setVariable in class AbstractNonPlayerCharacter
Parameters:
varName - The name of the variable
varValue - The value
See Also:
AbstractUser.setVariable(java.lang.String, java.lang.String)

speak

public void speak(AbstractRoom room,
                  String string)
This is an overriding method.

Specified by:
speak in interface AbstractUser
Overrides:
speak in class AbstractNonPlayerCharacter
Parameters:
room - the room in which to speak. Typically, the user must be present in that room.
string - the speech (or emote)
See Also:
AbstractUser.speak(org.starhope.appius.game.AbstractRoom, java.lang.String)

tick

public void tick(long currentTime,
                 long deltaTime)
          throws UserDeadException
This is an overriding method.

Parameters:
currentTime - Time since epoch at the start of the global metronome propagation, as per System.currentTimeMillis()
deltaTime - Delta-time in milliseconds since the prior global metronome tick
Throws:
UserDeadException - if a user has died during this tick
See Also:
AcceptsMetronomeTicks.tick(long, long)

toJSON

public org.json.JSONObject toJSON()
This is an overriding method.

Specified by:
toJSON in interface AbstractUser
Overrides:
toJSON in class AbstractNonPlayerCharacter
Returns:
a JavaScript Object representing this user
See Also:
AbstractUser.toJSON()

toSFSXML

public String toSFSXML()
This is an overriding method.

Specified by:
toSFSXML in interface AbstractUser
Overrides:
toSFSXML in class AbstractNonPlayerCharacter
Returns:
a string representing Smart Fox Server Pro style of XML data
See Also:
AbstractUser.toSFSXML()

updatePos

private void updatePos()
WRITEME: document this method (brpocock@star-hope.org, Feb 17, 2010)