com.tootsville.game
Class HauntedOrgan

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

public class HauntedOrgan
extends GameEvent

Author:
edward.winkelman@gmail.com

Nested Class Summary
private  class HauntedOrgan.HauntedOrganClickButton
          WRITEME edward.winkelman@gmail.com Oct 11, 2010
 
Field Summary
private  boolean dark
          If the room is dark or not
private  long lastClicked
          Click cooldown so that people can't spam
private  Room room
          Haunted organ room object
 
Fields inherited from class org.starhope.appius.game.GameEvent
freezeTag, gameCode, gameState, players, rooms, scores, scoreWatchRooms
 
Constructor Summary
HauntedOrgan(Zone z)
          WRITEME edward.winkelman@gmail.com 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 inRoom, 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
 long getLastClicked()
           
 String getName()
          Return a user-visible, unique name for this class.
 boolean isDark()
           
 void setDark(boolean darkNow)
           
 void setLastClicked(long thisClicked)
           
 
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, tick, toString, updateRoomVars, updateScore, updateScores
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dark

private transient boolean dark
If the room is dark or not


lastClicked

private transient long lastClicked
Click cooldown so that people can't spam


room

private final transient Room room
Haunted organ room object

Constructor Detail

HauntedOrgan

public HauntedOrgan(Zone z)
             throws NotFoundException,
                    GameLogicException
WRITEME edward.winkelman@gmail.com Sep 28, 2010

Parameters:
z - Zone in which haunted organ is placed
Throws:
NotFoundException - WRITEME
GameLogicException - WRITEME
Method Detail

acceptGameAction

public void acceptGameAction(AbstractUser u,
                             org.json.JSONObject action)
Description copied from interface: RoomListener
Broadcast message of a game action taking place

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 inRoom,
                                   org.json.JSONObject body)
Description copied from interface: RoomListener
Accept an out-of-band communications packet that was broadcast to a room in which this Listener is listening.

Parameters:
sender - The sender of the OOB message
inRoom - 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)
Description copied from interface: RoomListener
Accept a public chat message. This prototype does not specify the room, on the (potentially invalid) assumption that the room listener doesn't care from which room the speech was made.

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)

destroySelf

public void destroySelf()
Description copied from class: GameEvent
Destroy this event — during Zone shutdown usually

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

getGameEventPrefix

public String getGameEventPrefix()
Description copied from class: GameEvent
Get the prefix to be applied to event types for this game

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

getLastClicked

public long getLastClicked()
Returns:
the lastClicked

getName

public String getName()
Description copied from interface: HasName
Return a user-visible, unique name for this class. This name may not necessarily be globally unique, but must be unique across all objects of this class. For example, having both a User and a Zone named “Lightning” is acceptable, but there may not be two users with the same name.

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

isDark

public boolean isDark()
Returns:
the dark

setDark

public void setDark(boolean darkNow)
Parameters:
darkNow - the dark to set

setLastClicked

public void setLastClicked(long thisClicked)
Parameters:
thisClicked - the lastClicked to set