com.tootsville.game
Class ZapAttack

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

public final class ZapAttack
extends LaserTagGame

Author:
brpocock@star-hope.org, twheys@gmail.com, rdawson

Field Summary
private static long serialVersionUID
          The POJO serialization ID
 
Fields inherited from class org.starhope.appius.game.GameEvent
freezeTag, gameCode, gameState, players, rooms, scores, scoreWatchRooms
 
Constructor Summary
ZapAttack(Zone z)
           
 
Method Summary
 void acceptGameStateChange(GameEvent game, GameStateFlag newGameState)
          Accept notification of game state change.
 void acceptObjectJoinRoom(Room room, RoomListener object)
          Notification that someone has entered the 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 acceptPublicMessage(AbstractUser sender, Room room, String message)
          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.
 boolean equals(Object other)
          This is an overriding method.
 boolean equals(ZapAttack other)
          Determine if two instance pointers to Zap Attack are, in fact, the same instance
 String getGameEventPrefix()
          This is an overriding method.
 String getName()
          This is an overriding method.
protected  BigInteger getScoreForObject(String type, int subtype)
           
 int hashCode()
          This is an overriding method.
 void noOp()
          Guess what this doesn't do? Everything!
 
Methods inherited from class org.starhope.appius.game.laserTag.LaserTagGame
acceptGameAction, configUpdated, getLeaderBonus
 
Methods inherited from class org.starhope.appius.game.GameEvent
acceptCommand, acceptCommand, acceptObjectPartRoom, acceptUserVariableUpdate, changeGameState, compareTo, decrementScore, destroySelf, disconnect, equals, getCountdownDuration, getEveryone, getGameCode, getGameDuration, getGameShortName, getPlayers, getRoom, getRooms, getScoreWatchRooms, getSpectators, getTimer, getZone, 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

serialVersionUID

private static final long serialVersionUID
The POJO serialization ID

See Also:
Constant Field Values
Constructor Detail

ZapAttack

public ZapAttack(Zone z)
Parameters:
z - the zone in which the game is being played
Method Detail

acceptGameStateChange

public void acceptGameStateChange(GameEvent game,
                                  GameStateFlag newGameState)
Accept notification of game state change. Set up practice mode, if necessary; clear remaining targets upon leaving practice mode.

Specified by:
acceptGameStateChange in interface RoomListener
Overrides:
acceptGameStateChange in class LaserTagGame
Parameters:
game - This game, hopefully.
newGameState - The state into which we are entering.
See Also:
RoomListener.acceptGameStateChange(org.starhope.appius.game.GameEvent, org.starhope.appius.game.GameStateFlag)

acceptObjectJoinRoom

public void acceptObjectJoinRoom(Room room,
                                 RoomListener object)
Description copied from interface: RoomListener
Notification that someone has entered the room.

Specified by:
acceptObjectJoinRoom in interface RoomListener
Overrides:
acceptObjectJoinRoom in class GameEvent
Parameters:
room - The room
object - The thing (probably user) entering
See Also:
RoomListener.acceptObjectJoinRoom(Room, org.starhope.appius.game.RoomListener)

acceptOutOfBandMessage

public void acceptOutOfBandMessage(AbstractUser sender,
                                   Room room,
                                   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
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(AbstractUser, Room, JSONObject)

acceptPublicMessage

public void acceptPublicMessage(AbstractUser sender,
                                Room room,
                                String message)
This is an overriding method.

Specified by:
acceptPublicMessage in interface RoomListener
Overrides:
acceptPublicMessage in class GameEvent
Parameters:
sender - The speaker
room - The room in which the words were spoken
message - The spoken text or /emote
See Also:
RoomListener.acceptPublicMessage(AbstractUser, Room, String)

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)

equals

public boolean equals(Object other)
This is an overriding method.

Overrides:
equals in class GameEvent
See Also:
GameEvent.equals(java.lang.Object)

equals

public boolean equals(ZapAttack other)
Determine if two instance pointers to Zap Attack are, in fact, the same instance

Parameters:
other - Another ZapAttack instance against which to compare this one
Returns:
true, if the two objects refer to the same game instance

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

getScoreForObject

protected BigInteger getScoreForObject(String type,
                                       int subtype)
Specified by:
getScoreForObject in class LaserTagGame
Parameters:
type - the target type, "itm" or "obs"
subtype - the specific subtype of that target
Returns:
the number of peanuts earned for hitting the given target
See Also:
LaserTagGame.getScoreForObject(String, int)

hashCode

public int hashCode()
Description copied from class: GameEvent
This is an overriding method.

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

noOp

public void noOp()
Guess what this doesn't do? Everything!