|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.user.GeneralUser
org.starhope.appius.user.AbstractNonPlayerCharacter
com.tootsville.npc.DinerDiner
public class DinerDiner
A diner at the diner.
ShortOrderCook| Nested Class Summary | |
|---|---|
protected static class |
DinerDiner.State
The state of the diner's sequence of actions |
| Field Summary | |
|---|---|
private double |
happiness
How happy is the customer? Expressed as a tip rate. |
private static AtomicInteger |
nextID
Provide an unique ID counter for multiple instances of the same cook character in different Zones at the same time. |
private DinerDiner.State |
state
State, see DinerDiner.State |
private String |
wantFood
Food they want |
| Fields inherited from class org.starhope.appius.user.AbstractNonPlayerCharacter |
|---|
instanceID, myRoom |
| Fields inherited from class org.starhope.appius.user.GeneralUser |
|---|
userRecord |
| Constructor Summary | |
|---|---|
DinerDiner()
WRITEME: Document this constructor brpocock@star-hope.org |
|
| Method Summary | |
|---|---|
void |
acceptObjectJoinRoom(AbstractRoom room,
RoomListener object)
Notification that someone has entered the room. |
void |
acceptObjectPartRoom(AbstractRoom room,
RoomListener thing)
Notification that someone has left a room |
void |
acceptOutOfBandMessage(AbstractUser sender,
AbstractRoom 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(AbstractUser sender,
AbstractRoom room,
String message)
Accept a public chat message or /emote. |
void |
acceptPublicMessage(AbstractUser from,
String message)
Accept a public chat message. |
void |
acceptUserVariableUpdate(AbstractUser user,
String varName,
String varValue)
Receive notification of the change of an user variable |
void |
ban(AbstractUser u,
String banReason)
|
double |
getHappiness()
|
protected int |
getInstanceID()
|
DinerDiner.State |
getState()
|
String |
getWantFood()
|
void |
sendEarnings(AbstractRoom room,
String string)
|
void |
sendMigrate(AbstractZone refugeeZone)
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010) |
void |
sendUserLists()
Sends the user an asynchronous notification of their user lists' status. |
void |
sendWardrobe()
WRITEME |
void |
setHappiness(double newHappiness)
|
void |
setState(DinerDiner.State newState)
|
void |
setWantFood(String wantFoodNow)
|
void |
tick(long currentTime,
long deltaTime)
This method is called periodically from the metronome thread. |
| Methods inherited from class org.starhope.appius.user.GeneralUser |
|---|
getDialect, getDisplayName, getExtraColor, getFacing, getKickedByUserID, getKickedReasonCode, getKickedUntil, setAgeGroupToSystem, setBaseColor, setCanTalk |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private double happiness
private String wantFood
private DinerDiner.State state
DinerDiner.State
private static AtomicInteger nextID
Provide an unique ID counter for multiple instances of the same cook character in different Zones at the same time.
| Constructor Detail |
|---|
public DinerDiner()
throws NotFoundException,
GameLogicException
GameLogicException - WRITEME
NotFoundException - WRITEME| Method Detail |
|---|
public void acceptObjectJoinRoom(AbstractRoom room,
RoomListener object)
RoomListener
room - The roomobject - The thing (probably user) enteringRoomListener.acceptObjectJoinRoom(org.starhope.appius.game.AbstractRoom, org.starhope.appius.game.RoomListener)
public void acceptObjectPartRoom(AbstractRoom room,
RoomListener thing)
RoomListener
room - The roomthing - The thing (probably user) departingRoomListener.acceptObjectPartRoom(org.starhope.appius.game.AbstractRoom, org.starhope.appius.game.RoomListener)
public void acceptOutOfBandMessage(AbstractUser sender,
AbstractRoom room,
org.json.JSONObject body)
RoomListener
sender - The sender of the OOB messageroom - The room in which the OOB message is being broadcastbody - A JSON object containing the OOB message. The
contents of this message are not constrained.RoomListener.acceptOutOfBandMessage(org.starhope.appius.user.AbstractUser, org.starhope.appius.game.AbstractRoom, org.json.JSONObject)
public void acceptPublicMessage(AbstractUser sender,
AbstractRoom room,
String message)
RoomListener
acceptPublicMessage in interface RoomListeneracceptPublicMessage in class AbstractNonPlayerCharactersender - The speakerroom - The room in which the words were spokenmessage - The spoken text or /emoteRoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser, org.starhope.appius.game.AbstractRoom, java.lang.String)
public void acceptPublicMessage(AbstractUser from,
String message)
RoomListener
acceptPublicMessage in interface RoomListeneracceptPublicMessage in class AbstractNonPlayerCharacterfrom - The speakermessage - The spoken text or /emoteRoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser, java.lang.String)
public void acceptUserVariableUpdate(AbstractUser user,
String varName,
String varValue)
RoomListener
user - The user updating their variablevarName - The name of the variable (key)varValue - The new value (null if unset)RoomListener.acceptUserVariableUpdate(org.starhope.appius.user.AbstractUser, java.lang.String, java.lang.String)
public void ban(AbstractUser u,
String banReason)
throws PrivilegeRequiredException
u - WRITEMEbanReason - WRITEME
PrivilegeRequiredException - WRITEMEAbstractUser.ban(org.starhope.appius.user.AbstractUser, java.lang.String)public double getHappiness()
protected int getInstanceID()
getInstanceID in class AbstractNonPlayerCharacterAbstractNonPlayerCharacter.getInstanceID()public DinerDiner.State getState()
public String getWantFood()
public void sendEarnings(AbstractRoom room,
String string)
room - WRITEMEstring - WRITEMEAbstractUser.sendEarnings(org.starhope.appius.game.AbstractRoom, java.lang.String)
public void sendMigrate(AbstractZone refugeeZone)
throws UserDeadException
AbstractUser
refugeeZone - WRITEME
UserDeadException - WRITEMEAbstractUser.sendMigrate(org.starhope.appius.types.AbstractZone)public void sendUserLists()
AbstractUser
AbstractUser.sendUserLists()public void sendWardrobe()
AbstractUser
AbstractUser.sendWardrobe()public void setHappiness(double newHappiness)
newHappiness - the happiness to setpublic void setState(DinerDiner.State newState)
newState - the state to setpublic void setWantFood(String wantFoodNow)
wantFoodNow - the wantFood to set
public void tick(long currentTime,
long deltaTime)
throws UserDeadException
AcceptsMetronomeTicks
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
UserDeadException - if a user has died during this tickAcceptsMetronomeTicks.tick(long,
long)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||