com.tootsville.game
Class Tootlympics

java.lang.Object
  extended by org.starhope.appius.game.GameEvent
      extended by com.tootsville.game.Tootlympics
All Implemented Interfaces:
Comparable<Object>, RoomListener, AcceptsMetronomeTicks, HasName

public class Tootlympics
extends GameEvent

Tootlympics scoreboard and torch-lighting magic with Superstar

Author:
brpocock@star-hope.org

Field Summary
(package private)  int bottom
          WRITEME: document this field (brpocock@star-hope.org, Feb 12, 2010) bottom (Tootlympics)
(package private)  int left
          WRITEME: document this field (brpocock@star-hope.org, Feb 12, 2010) left (Tootlympics)
private  long nextUpdate
          Time to next refresh scoreboard
(package private)  int right
          WRITEME: document this field (brpocock@star-hope.org, Feb 12, 2010) right (Tootlympics)
private static long serialVersionUID
          Java Serialisation
(package private)  int top
          WRITEME: document this field (brpocock@star-hope.org, Feb 12, 2010) top (Tootlympics)
 
Fields inherited from class org.starhope.appius.game.GameEvent
freezeTag, gameCode, gameState, players, rooms, scores, scoreWatchRooms
 
Constructor Summary
Tootlympics(Zone z)
          Instantiate the Tootlympics into a Zone
 
Method Summary
 void acceptGameAction(AbstractUser u, org.json.JSONObject action)
          This is an overriding method.
 void acceptOutOfBandMessage(AbstractUser sender, Room room, org.json.JSONObject body)
          This is an overriding method.
 void acceptPublicMessage(AbstractUser from, String message)
          This is an overriding method.
 void acceptUserAction(Room r, AbstractUser u)
          User actions (go/do actions) propagate through this channel.
 void acceptUserVariableUpdate(AbstractUser user, String varName, String varValue)
          This is an overriding method.
 String getGameEventPrefix()
          This is an overriding method.
 String getName()
          This is an overriding method.
 void tick(long currentTime, long deltaTime)
          This is an overriding method.
protected  void updateRoomVars()
          This is an overriding method.
protected  void updateScores()
          This is an overriding method.
 
Methods inherited from class org.starhope.appius.game.GameEvent
acceptCommand, acceptCommand, acceptGameStateChange, acceptObjectJoinRoom, acceptObjectPartRoom, acceptPublicMessage, changeGameState, compareTo, decrementScore, destroySelf, disconnect, equals, equals, getCountdownDuration, getEveryone, getGameCode, getGameDuration, getGameShortName, getLeaderBonus, getPlayers, getRoom, getRooms, getScoreWatchRooms, getSpectators, getTimer, getZone, hashCode, incrementScore, propagateGameStateChange, resetPlayers, sendEndEvents, sendStartEvents, toString, updateScore
 
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

See Also:
Constant Field Values

bottom

int bottom
WRITEME: document this field (brpocock@star-hope.org, Feb 12, 2010) bottom (Tootlympics)


left

int left
WRITEME: document this field (brpocock@star-hope.org, Feb 12, 2010) left (Tootlympics)


nextUpdate

private long nextUpdate
Time to next refresh scoreboard


right

int right
WRITEME: document this field (brpocock@star-hope.org, Feb 12, 2010) right (Tootlympics)


top

int top
WRITEME: document this field (brpocock@star-hope.org, Feb 12, 2010) top (Tootlympics)

Constructor Detail

Tootlympics

public Tootlympics(Zone z)
Instantiate the Tootlympics into a Zone

Parameters:
z - The Zone into which it should be instantiated
Method Detail

acceptGameAction

public void acceptGameAction(AbstractUser u,
                             org.json.JSONObject action)
This is an overriding method.

Parameters:
u - the sender
action - The game action. The verb is in action.getString("action").
See Also:
RoomListener.acceptGameAction(org.starhope.appius.user.AbstractUser, org.json.JSONObject)

acceptOutOfBandMessage

public void acceptOutOfBandMessage(AbstractUser sender,
                                   Room room,
                                   org.json.JSONObject body)
This is an overriding method.

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.Room, org.json.JSONObject)

acceptPublicMessage

public void acceptPublicMessage(AbstractUser from,
                                String message)
This is an overriding method.

Parameters:
from - The speaker
message - The spoken text or /emote
See Also:
RoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser, java.lang.String)

acceptUserAction

public void acceptUserAction(Room r,
                             AbstractUser u)
Description copied from interface: RoomListener
User actions (go/do actions) propagate through this channel.

Parameters:
r - the room in which the user is taking an action
u - the user taking an action
See Also:
RoomListener.acceptUserAction(org.starhope.appius.game.Room, org.starhope.appius.user.AbstractUser)

acceptUserVariableUpdate

public void acceptUserVariableUpdate(AbstractUser user,
                                     String varName,
                                     String varValue)
This is an overriding method.

Specified by:
acceptUserVariableUpdate in interface RoomListener
Overrides:
acceptUserVariableUpdate in class GameEvent
Parameters:
user - The user updating their variable
varName - The name of the variable (key)
varValue - The new value (null if unset)
See Also:
GameEvent.acceptUserVariableUpdate(org.starhope.appius.user.AbstractUser, java.lang.String, java.lang.String)

getGameEventPrefix

public String getGameEventPrefix()
This is an overriding method.

Specified by:
getGameEventPrefix in class GameEvent
Returns:
the string prefix used to find event types for this game
See Also:
GameEvent.getGameEventPrefix()

getName

public String getName()
This is an overriding method.

Returns:
a user-visible string name for this instance
See Also:
HasName.getName()

tick

public void tick(long currentTime,
                 long deltaTime)
          throws UserDeadException
This is an overriding method.

Specified by:
tick in interface AcceptsMetronomeTicks
Overrides:
tick in class GameEvent
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:
GameEvent.tick(long, long)

updateRoomVars

protected void updateRoomVars()
This is an overriding method.

Overrides:
updateRoomVars in class GameEvent
See Also:
GameEvent.updateRoomVars()

updateScores

protected void updateScores()
This is an overriding method.

Overrides:
updateScores in class GameEvent
See Also:
GameEvent.updateScores()