com.tootsville.game
Class PropsWeather

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

public class PropsWeather
extends GameEvent

Set the weather value to the special Props animation on each screen across the main row of Tootsville on a timer

Author:
brpocock@star-hope.org

Field Summary
private  Room[] animationRooms
          The ordered set of rooms for which the weather is to be set
private  long phase
          The current phase of the animation sequence
private static long serialVersionUID
          Java serialization unique ID
 
Fields inherited from class org.starhope.appius.game.GameEvent
freezeTag, gameCode, gameState, players, rooms, scores, scoreWatchRooms
 
Constructor Summary
PropsWeather(Zone z)
          Instantiate the Props weather pattern
 
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.
 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.
 
Methods inherited from class org.starhope.appius.game.GameEvent
acceptCommand, acceptCommand, acceptGameStateChange, acceptObjectJoinRoom, acceptObjectPartRoom, acceptPublicMessage, acceptUserVariableUpdate, 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, updateScores
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Java serialization unique ID

See Also:
Constant Field Values

animationRooms

private final Room[] animationRooms
The ordered set of rooms for which the weather is to be set


phase

private long phase
The current phase of the animation sequence

Constructor Detail

PropsWeather

public PropsWeather(Zone z)
Instantiate the Props weather pattern

Parameters:
z - The zone to which it should be connected
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)

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()