com.tootsville.npc
Class Volleyball

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

public class Volleyball
extends SoccerBall

Author:
ewinkelman
See Also:
Serialized Form

Field Summary
private static AtomicInteger nextInstanceID
          Static next instance ID for keeping track of instances of soccer balls
private static long serialVersionUID
          Java serialisation unique ID
 
Fields inherited from class com.tootsville.npc.SoccerBall
BALL_RADIUS
 
Fields inherited from class org.starhope.appius.user.AbstractNonPlayerCharacter
buddyList, casualSpeechQueue, casualSpeechRate, instanceID, kalendor, lastActive, lastSpoken
 
Fields inherited from class org.starhope.appius.user.GeneralUser
baseStats, collisionBounds, currentRoom, facing, lastUserMovement, pathFinder, userRecord
 
Constructor Summary
Volleyball()
          Create an instance of a soccer ball
 
Method Summary
 org.starhope.appius.geometry.Coord2D getCenterOfMass()
          Gets the object's current center of mass in world coordinates
 long getEndMovementTime(long currentTime)
          Ball is velocity based and doesn't have predetermined start/stop
protected  int getInstanceID()
           
 double getMass()
          Gets the mass of the collidable object
 long getStartMovementTime()
           
 org.starhope.appius.geometry.Vector2D getVelocity()
          Gets the object's current velocity
 void sendOops()
          WRITEME
 void sendResponse(org.json.JSONObject result)
           
 void sendWardrobe()
          WRITEME
 void setCenterOfMass(org.starhope.appius.geometry.Coord2D com)
          Sets the object's new center of mass in world space coordinates (i.e.
 void setVelocity(org.starhope.appius.geometry.Vector2D velocity)
          This method does nothing because we shouldn't be setting the speed and direction of users
 void tick(long currentTime, long deltaTime)
          This method is called periodically from the metronome thread.
 
Methods inherited from class com.tootsville.npc.SoccerBall
acceptObjectJoinRoom, acceptObjectPartRoom, acceptOutOfBandMessage, acceptUserVariableUpdate, ban, getCollisionBounds, sendEarnings, setTravelRate
 
Methods inherited from class org.starhope.appius.user.AbstractNonPlayerCharacter
acceptErrorReply, acceptGameAction, acceptGameStateChange, acceptMessage, acceptPrivateMessage, acceptPublicMessage, acceptPublicMessage, acceptSuccessReply, acceptUserList, addBuddy, addGiftSubscription, addItem, canTalk, destroy, doTransport, equals, getAccessibleRooms, getAvatarClass, getAvatarLabel, getBaseColor, getBuddyListNames, getDebugName, getGreeting, getIPAddress, getKickedMessage, getLag, getLanguage, getLocation, getMail, getName, getNameApprovedAt, getNameRequestedAt, getNameStripped, getPublicInfo_new, getServerThread, hashCode, inviteBuddy, isBuddy, isNPC, isOnline, isPaidMember, kick, liftBan, needsParent, reportedToModeratorBy, reportedToModeratorBy, sendMigrate, setLastActive, setMail, setParent, speak, speakCasually, toJSON, toSFSXML, toString, whenAtTarget
 
Methods inherited from class org.starhope.appius.user.GeneralUser
acceptUserAction, assertLocationUnlocked, assertStaffLevel, attend, canApproveSelf, canBetaTest, canEnterChatZone, canEnterMenuZone, changeBaseDefenses, compareTo, deleteVariable, doffClothes, getAge, getAgeGroup, getApprovedDateString, getBaseDefenses, getBaseStat, getCurrentAction, getD, getDialect, getDisplayName, getEffectiveDefenses, getExtraColor, getFacing, getGameEquipItems_JSON, getGameEquipItems, getHeight, getHouse, getInventory, getItemsByType, getItemsByType, getItemsByTypeAsArray, getKickedByUserID, getKickedReasonCode, getKickedUntil, getLocationForUpdate, getMoney, getPathFinder, getPublicInfo, getRegisteredAt, getRegisteredDate, getRegisteredDateString, getRequestedName, getResponsibleMail, getRoom, getRoomNumber, getSizeScalar, getStaffLevel, getStartT, getStat, getTarget, getTravelRate, getTravelStart, getUserID, getUserListIterator, getUserName, getUserVariables, getVariable, getVariables, getVariablesJSON, getWallet, getZone, handleWalkFail, hasStaffLevel, hasVariable, ignore, isActive, isApproved, isBanned, isCanceled, isKicked, local_publicInfo, purchase, removeBuddy, resetVariables, sendBuddyList, sendEarnings, sendEarnings, setAgeGroupToSystem, setBackingRecord, setBaseColor, setCanTalk, setCurrentAction, setExtraColor, setFacing, setLocation, setRoom, setStartT, setTarget, setTravelStart, setVariable, setVariable, setVariables, takeAttack, unlockLocation, updateWallet
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Java serialisation unique ID

See Also:
Constant Field Values

nextInstanceID

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

Constructor Detail

Volleyball

public Volleyball()
           throws NotFoundException,
                  GameLogicException
Create an instance of a soccer ball

Throws:
GameLogicException - WRITEME
NotFoundException - WRITEME
Method Detail

getCenterOfMass

public org.starhope.appius.geometry.Coord2D getCenterOfMass()
Description copied from interface: Collidable
Gets the object's current center of mass in world coordinates

Specified by:
getCenterOfMass in interface Collidable
Overrides:
getCenterOfMass in class SoccerBall
Returns:
A 2D point representing the center of mass
See Also:
Collidable.getCenterOfMass()

getEndMovementTime

public long getEndMovementTime(long currentTime)
Ball is velocity based and doesn't have predetermined start/stop

Specified by:
getEndMovementTime in interface Collidable
Overrides:
getEndMovementTime in class SoccerBall
Parameters:
currentTime - The current time
Returns:
the time the object will stop moving
See Also:
Collidable.getEndMovementTime(long)

getInstanceID

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

getMass

public double getMass()
Description copied from interface: Collidable
Gets the mass of the collidable object

Specified by:
getMass in interface Collidable
Overrides:
getMass in class SoccerBall
Returns:
Mass
See Also:
Collidable.getMass()

getStartMovementTime

public long getStartMovementTime()
Specified by:
getStartMovementTime in interface Collidable
Overrides:
getStartMovementTime in class SoccerBall
Returns:
the time the object started moving
See Also:
Collidable.getStartMovementTime()

getVelocity

public org.starhope.appius.geometry.Vector2D getVelocity()
Description copied from interface: Collidable
Gets the object's current velocity

Specified by:
getVelocity in interface Collidable
Overrides:
getVelocity in class SoccerBall
Returns:
WRITEME
See Also:
Collidable.getVelocity()

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

Specified by:
sendWardrobe in interface AbstractUser
Overrides:
sendWardrobe in class SoccerBall
See Also:
AbstractUser.sendWardrobe()

setCenterOfMass

public void setCenterOfMass(org.starhope.appius.geometry.Coord2D com)
Description copied from interface: Collidable
Sets the object's new center of mass in world space coordinates (i.e. this moves the object and doesn't reposition the relative location of the center of mass with respect to its bounds)

Specified by:
setCenterOfMass in interface Collidable
Overrides:
setCenterOfMass in class SoccerBall
Parameters:
com - WRITEME
See Also:
Collidable.setCenterOfMass(Coord2D)

setVelocity

public void setVelocity(org.starhope.appius.geometry.Vector2D velocity)
Description copied from class: GeneralUser
This method does nothing because we shouldn't be setting the speed and direction of users

WRITEME: explain why? We do manipulate these values, regardless…

Specified by:
setVelocity in interface Collidable
Overrides:
setVelocity in class SoccerBall
Parameters:
velocity - WRITEME
See Also:
Collidable.setVelocity(Vector2D)

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.

Specified by:
tick in interface AcceptsMetronomeTicks
Overrides:
tick in class SoccerBall
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)