|
||||||||||
| 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.SoccerBall
public class SoccerBall
WRITEME
| Field Summary | |
|---|---|
protected int |
BALL_RADIUS
ball radius |
private static AtomicInteger |
nextInstanceID
Static next instance ID for keeping track of instances of soccer balls |
private static long |
serialVersionUID
WRITEME: Document this brpocock@star-hope.org |
| 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 | |
|---|---|
|
SoccerBall()
Create an instance of a soccer ball |
protected |
SoccerBall(String who)
pass-through visibility of super constructor for volleyball |
| Method Summary | |
|---|---|
void |
acceptObjectJoinRoom(Room room,
RoomListener object)
Notification that someone has entered the room. |
void |
acceptObjectPartRoom(Room room,
RoomListener thing)
Notification that someone has left a room |
void |
acceptOutOfBandMessage(AbstractUser 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 |
acceptUserVariableUpdate(AbstractUser user,
String varName,
String varValue)
Receive notification of the change of an user variable |
void |
ban(AbstractUser u,
String banReason)
|
org.starhope.appius.geometry.Coord2D |
getCenterOfMass()
Gets the object's current center of mass in world coordinates |
org.starhope.appius.geometry.PolygonPrimitive<?> |
getCollisionBounds()
Gets the collision boundaries for the object |
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 |
sendEarnings(Room room,
String string)
|
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 |
setTravelRate(double rate)
This is an overriding method. |
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 java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private static AtomicInteger nextInstanceID
protected final int BALL_RADIUS
| Constructor Detail |
|---|
public SoccerBall()
throws NotFoundException,
GameLogicException
GameLogicException - WRITEME
NotFoundException - WRITEME
protected SoccerBall(String who)
throws NotFoundException,
GameLogicException
who - WRITEME
NotFoundException - WRITEME
GameLogicException - WRITEME| Method Detail |
|---|
public void acceptObjectJoinRoom(Room room,
RoomListener object)
RoomListener
acceptObjectJoinRoom in interface RoomListeneracceptObjectJoinRoom in class GeneralUserroom - The roomobject - The thing (probably user) enteringRoomListener.acceptObjectJoinRoom(org.starhope.appius.game.Room,
org.starhope.appius.game.RoomListener)
public void acceptObjectPartRoom(Room room,
RoomListener thing)
RoomListener
acceptObjectPartRoom in interface RoomListeneracceptObjectPartRoom in class GeneralUserroom - The roomthing - The thing (probably user) departingRoomListener.acceptObjectPartRoom(org.starhope.appius.game.Room,
org.starhope.appius.game.RoomListener)
public void acceptOutOfBandMessage(AbstractUser sender,
Room room,
org.json.JSONObject body)
RoomListener
acceptOutOfBandMessage in interface RoomListeneracceptOutOfBandMessage in class GeneralUsersender - 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.Room, org.json.JSONObject)
public void acceptUserVariableUpdate(AbstractUser user,
String varName,
String varValue)
RoomListener
acceptUserVariableUpdate in interface RoomListeneracceptUserVariableUpdate in class GeneralUseruser - 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 org.starhope.appius.geometry.Coord2D getCenterOfMass()
Collidable
getCenterOfMass in interface CollidablegetCenterOfMass in class GeneralUserCollidable.getCenterOfMass()public org.starhope.appius.geometry.PolygonPrimitive<?> getCollisionBounds()
Collidable
getCollisionBounds in interface CollidablegetCollisionBounds in class GeneralUserCollidable.getCollisionBounds()public long getEndMovementTime(long currentTime)
getEndMovementTime in interface CollidablegetEndMovementTime in class GeneralUsercurrentTime - The current time
Collidable.getEndMovementTime(long)protected int getInstanceID()
getInstanceID in class AbstractNonPlayerCharacterAbstractNonPlayerCharacter.getInstanceID()public double getMass()
Collidable
getMass in interface CollidablegetMass in class GeneralUserCollidable.getMass()public long getStartMovementTime()
getStartMovementTime in interface CollidablegetStartMovementTime in class GeneralUserCollidable.getStartMovementTime()public org.starhope.appius.geometry.Vector2D getVelocity()
Collidable
getVelocity in interface CollidablegetVelocity in class GeneralUserCollidable.getVelocity()
public void sendEarnings(Room room,
String string)
sendEarnings in interface AbstractUsersendEarnings in class GeneralUserroom - WRITEMEstring - WRITEMEAbstractUser.sendEarnings(org.starhope.appius.game.Room,
java.lang.String)public void sendWardrobe()
AbstractUser
sendWardrobe in interface AbstractUsersendWardrobe in class GeneralUserAbstractUser.sendWardrobe()public void setCenterOfMass(org.starhope.appius.geometry.Coord2D com)
Collidable
setCenterOfMass in interface CollidablesetCenterOfMass in class GeneralUsercom - WRITEMECollidable.setCenterOfMass(Coord2D)public void setTravelRate(double rate)
GeneralUser
setTravelRate in interface AbstractUsersetTravelRate in class GeneralUserrate - WRITEMEGeneralUser.setTravelRate(double)public void setVelocity(org.starhope.appius.geometry.Vector2D velocity)
GeneralUserWRITEME: explain why? We do manipulate these values, regardless…
setVelocity in interface CollidablesetVelocity in class GeneralUservelocity - WRITEMECollidable.setVelocity(Vector2D)
public void tick(long currentTime,
long deltaTime)
throws UserDeadException
AcceptsMetronomeTicks
tick in interface AcceptsMetronomeTickstick in class AbstractNonPlayerCharactercurrentTime - 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 | |||||||||