|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.game.GameEvent
com.tootsville.game.ShadowTree
public class ShadowTree
| Field Summary | |
|---|---|
private org.starhope.appius.geometry.Polygon |
branchArea
Special area on the branch to cause it to break |
private int |
branchState
If the branch is in the down position |
private org.starhope.appius.geometry.Polygon |
brokenBranchArea
Special area for when the branch is broken |
private double |
hitpoints
Tree branch hit points |
private org.starhope.appius.geometry.Rectangle |
landing
Landing area for falling toots |
private long |
lastShake
The last time that the branch was shaken |
private Room |
room
Soccer field room object |
private ConcurrentHashMap<AbstractUser,Double> |
userHits
User hits so that one user can't just spam jump |
| Fields inherited from class org.starhope.appius.game.GameEvent |
|---|
freezeTag, gameCode, gameState, players, rooms, scores, scoreWatchRooms |
| Constructor Summary | |
|---|---|
ShadowTree(Zone z)
WRITEME brpocock@star-hope.org Sep 28, 2010 |
|
| Method Summary | |
|---|---|
void |
acceptGameAction(AbstractUser u,
org.json.JSONObject action)
Broadcast message of a game action taking place |
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 |
acceptPublicMessage(AbstractUser from,
String message)
Accept a public chat message. |
void |
acceptUserAction(Room r,
AbstractUser u)
User actions (go/do actions) propagate through this channel. |
void |
destroySelf()
Destroy this event — during Zone shutdown usually |
String |
getGameEventPrefix()
Get the prefix to be applied to event types for this game |
String |
getName()
Return a user-visible, unique name for this class. |
private void |
shakeLimb()
Shakes the limb every two seconds max |
void |
tick(long currentTime,
long deltaTime)
This method is called periodically from the metronome thread. |
| Methods inherited from class org.starhope.appius.game.GameEvent |
|---|
acceptCommand, acceptCommand, acceptGameStateChange, acceptObjectJoinRoom, acceptObjectPartRoom, acceptPublicMessage, acceptUserVariableUpdate, changeGameState, compareTo, decrementScore, disconnect, equals, equals, getCountdownDuration, getEveryone, getGameCode, getGameDuration, getGameShortName, getLeaderBonus, getPlayers, getRoom, getRooms, getScoreWatchRooms, getSpectators, getTimer, getZone, hashCode, incrementScore, propagateGameStateChange, resetPlayers, sendEndEvents, sendStartEvents, toString, updateRoomVars, updateScore, updateScores |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final transient org.starhope.appius.geometry.Polygon branchArea
private transient int branchState
private final transient org.starhope.appius.geometry.Polygon brokenBranchArea
private transient double hitpoints
private final transient org.starhope.appius.geometry.Rectangle landing
private transient long lastShake
private final transient Room room
private final transient ConcurrentHashMap<AbstractUser,Double> userHits
| Constructor Detail |
|---|
public ShadowTree(Zone z)
throws NotFoundException,
GameLogicException
z - Zone in which tree is placed
NotFoundException - WRITEME
GameLogicException - WRITEME| Method Detail |
|---|
public void acceptGameAction(AbstractUser u,
org.json.JSONObject action)
RoomListener
u - the senderaction - The game action. The verb is in
action.getString("action").RoomListener.acceptGameAction(org.starhope.appius.user.AbstractUser,
org.json.JSONObject)
public void acceptOutOfBandMessage(AbstractUser sender,
Room 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.Room, org.json.JSONObject)
public void acceptPublicMessage(AbstractUser from,
String message)
RoomListener
from - The speakermessage - The spoken text or /emoteRoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser,
java.lang.String)
public void acceptUserAction(Room r,
AbstractUser u)
RoomListener
r - the room in which the user is taking an actionu - the user taking an actionRoomListener.acceptUserAction(org.starhope.appius.game.Room,
org.starhope.appius.user.AbstractUser)public void destroySelf()
GameEvent
destroySelf in class GameEventGameEvent.destroySelf()public String getGameEventPrefix()
GameEvent
getGameEventPrefix in class GameEventGameEvent.getGameEventPrefix()public String getName()
HasName
HasName.getName()private void shakeLimb()
public void tick(long currentTime,
long deltaTime)
throws UserDeadException
AcceptsMetronomeTicks
tick in interface AcceptsMetronomeTickstick in class GameEventcurrentTime - 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 tickGameEvent.tick(long, long)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||