com.tootsville.npc
Class SoccerReferee

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

public class SoccerReferee
extends AbstractNonPlayerCharacter

Author:
ewinkelman

Field Summary
private  long lastCasualInvite
          WRITEME: Document this brpocock
private static AtomicInteger nextInstanceID
          Static next instance ID for keeping track of instances of soccer balls
 
Fields inherited from class org.starhope.appius.user.AbstractNonPlayerCharacter
buddyList, instanceID, lastActive
 
Fields inherited from class org.starhope.appius.user.GeneralUser
collisionBounds, currentRoom, facing, lastUserMovement, userRecord
 
Constructor Summary
SoccerReferee()
           
 
Method Summary
 void acceptMessage(String title, String label, String content)
          Accept an administrative/moderator message with the full range of options.
 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)
           
protected  int getInstanceID()
          Gets the NPC's instance ID
 void sendEarnings(AbstractRoom room, String string)
           
 void sendMigrate(AbstractZone refugeeZone)
          WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)
 void sendOops()
          WRITEME
 void sendResponse(org.json.JSONObject result)
           
 void sendWardrobe()
          WRITEME
 void tick(long currentTime, long deltaTime)
          This method is called periodically from the metronome thread.
 
Methods inherited from class org.starhope.appius.user.AbstractNonPlayerCharacter
acceptErrorReply, acceptGameAction, acceptGameStateChange, acceptPrivateMessage, acceptSuccessReply, acceptUserList, addGiftSubscription, addItem, canTalk, compareTo, destroy, doTransport, equals, getAvatarClass, getAvatarLabel, getBaseColor, getBuddyListNames, getDebugName, getGreeting, getIPAddress, getKickedMessage, getLag, getLanguage, getLocation, getMail, getName, getNameApprovedAt, getNameRequestedAt, getNameStripped, getPublicInfo_new, getServerThread, hashCode, isBuddy, isNPC, isOnline, kick, liftBan, needsParent, reportedToModeratorBy, reportedToModeratorBy, setLastActive, setMail, setParent, speak, toJSON, toSFSXML
 
Methods inherited from class org.starhope.appius.user.GeneralUser
addBuddy, assertLocationUnlocked, assertStaffLevel, attend, canApproveSelf, canBetaTest, canEnterChatZone, canEnterMenuZone, deleteVariable, doffClothes, getAge, getAgeGroup, getApprovedDateString, getCenterOfMass, getCollisionBounds, getCurrentAction, getD, getDialect, getDisplayName, getEndMovementTime, getExtraColor, getFacing, getGameEquipItems_JSON, getGameEquipItems, getHeight, getHouse, getInventory, getItemsByType, getItemsByType, getItemsByTypeAsArray, getKickedByUserID, getKickedReasonCode, getKickedUntil, getLocationForUpdate, getMass, getMoney, getPublicInfo, getRegisteredAt, getRegisteredDate, getRegisteredDateString, getRequestedName, getResponsibleMail, getRoom, getRoomNumber, getSizeScalar, getStaffLevel, getStartMovementTime, getStartT, getTarget, getTravelRate, getTravelStart, getUserID, getUserListIterator, getUserName, getUserVariables, getVariable, getVariables, getVariablesJSON, getVelocity, getWallet, getZone, hasStaffLevel, hasVariable, ignore, isActive, isApproved, isBanned, isCanceled, isKicked, isPaidMember, local_publicInfo, purchase, removeBuddy, resetVariables, setAgeGroupToSystem, setBaseColor, setCanTalk, setCenterOfMass, setCurrentAction, setExtraColor, setFacing, setLocation, setRoom, setStartT, setTarget, setTravelRate, setTravelStart, setVariable, setVariable, setVariables, setVelocity, unlockLocation, updateWallet
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nextInstanceID

private static AtomicInteger nextInstanceID
Static next instance ID for keeping track of instances of soccer balls


lastCasualInvite

private long lastCasualInvite
WRITEME: Document this brpocock

Constructor Detail

SoccerReferee

public SoccerReferee()
              throws NotFoundException,
                     GameLogicException
Throws:
NotFoundException - WRITEME
GameLogicException - WRITEME
Method Detail

acceptMessage

public void acceptMessage(String title,
                          String label,
                          String content)
Description copied from interface: AbstractUser
Accept an administrative/moderator message with the full range of options. If the user is currently online, forward this message to them.

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)
Description copied from interface: RoomListener
Notification that someone has entered the room.

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)
Description copied from interface: RoomListener
Notification that someone has left a room

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)
Description copied from interface: RoomListener
Accept an out-of-band communications packet that was broadcast to a room in which this Listener is listening.

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)
Description copied from interface: RoomListener
Accept a public chat message or /emote.

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)
Description copied from interface: RoomListener
Accept a public chat message. This prototype does not specify the room, on the (potentially invalid) assumption that the room listener doesn't care from which room the speech was made.

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)

acceptUserVariableUpdate

public void acceptUserVariableUpdate(AbstractUser user,
                                     String varName,
                                     String varValue)
Description copied from interface: RoomListener
Receive notification of the change of an user variable

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)

ban

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

getInstanceID

protected int getInstanceID()
Gets the NPC's instance ID

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

sendEarnings

public void sendEarnings(AbstractRoom room,
                         String string)
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
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)

Specified by:
sendMigrate in interface AbstractUser
Overrides:
sendMigrate in class AbstractNonPlayerCharacter
Parameters:
refugeeZone - WRITEME
Throws:
UserDeadException - WRITEME
See Also:
AbstractUser.sendMigrate(org.starhope.appius.types.AbstractZone)

sendOops

public void sendOops()
Description copied from interface: AbstractUser
WRITEME

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

sendResponse

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

sendWardrobe

public void sendWardrobe()
Description copied from interface: AbstractUser
WRITEME

See Also:
AbstractUser.sendWardrobe()

tick

public void tick(long currentTime,
                 long deltaTime)
          throws UserDeadException
Description copied from interface: AcceptsMetronomeTicks
This method is called periodically from the metronome thread. To save computation, it receives both the current time since epoch in milliseconds at the start of the global tick propagation, and the delta time since the previous metronome tick.

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)