edu.uiuc.cs397rhc.game
Class AbilityEvent

java.lang.Object
  extended by java.util.EventObject
      extended by edu.uiuc.cs397rhc.game.GameEvent
          extended by edu.uiuc.cs397rhc.game.AbilityEvent
All Implemented Interfaces:
java.io.Serializable

public class AbilityEvent
extends GameEvent

Represents a player using a specific ability.

Author:
Steven N. Severinghaus
See Also:
GameUtils, Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
AbilityEvent(java.lang.Object source, GameUtils.Team team, GameUtils.Ability ability)
           
AbilityEvent(java.lang.Object source, GameUtils.Team team, GameUtils.Ability ability, GameUtils.PlayerState state, GameUtils.MapArea area)
          Constructs an ability event for the specified team and ability, coming from the specified source.
 
Method Summary
 GameUtils.Ability getAbility()
          Returns the specific ability being used.
 GameUtils.MapArea getMapArea()
          Returns the area in which the ability is being used.
 GameUtils.PlayerState getPlayerState()
          Returns the state of the player using the ability.
 GameUtils.Team getTeam()
          Returns the team of the player using the ability.
 void setAbility(GameUtils.Ability ability)
          Sets the specific ability being used.
 void setMapArea(GameUtils.MapArea area)
          Sets the area in which the ability is being used.
 void setPlayerState(GameUtils.PlayerState state)
          Sets the state of the player using the ability.
 void setTeam(GameUtils.Team team)
          Sets the team of the player using the ability.
 java.lang.String toString()
          Returns a string representation of this ability event.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbilityEvent

public AbilityEvent(java.lang.Object source,
                    GameUtils.Team team,
                    GameUtils.Ability ability,
                    GameUtils.PlayerState state,
                    GameUtils.MapArea area)
Constructs an ability event for the specified team and ability, coming from the specified source.

Parameters:
source - the source of the ability event
team - the team of the player using the ability
ability - the specific ability being used
area - the area in which the ability is being used

AbilityEvent

public AbilityEvent(java.lang.Object source,
                    GameUtils.Team team,
                    GameUtils.Ability ability)
Method Detail

getTeam

public GameUtils.Team getTeam()
Returns the team of the player using the ability.

Returns:
the team of the player using the ability

getAbility

public GameUtils.Ability getAbility()
Returns the specific ability being used.

Returns:
the specific ability being used

getPlayerState

public GameUtils.PlayerState getPlayerState()
Returns the state of the player using the ability.

Returns:
the state of the player using the ability

getMapArea

public GameUtils.MapArea getMapArea()
Returns the area in which the ability is being used.

Returns:
the area in which the ability is being used

setTeam

public void setTeam(GameUtils.Team team)
Sets the team of the player using the ability.

Parameters:
team - the team of the player using the abilty

setAbility

public void setAbility(GameUtils.Ability ability)
Sets the specific ability being used.

Parameters:
ability - the specific ability being used

setPlayerState

public void setPlayerState(GameUtils.PlayerState state)
Sets the state of the player using the ability.

Parameters:
state - the state of the player using the ability

setMapArea

public void setMapArea(GameUtils.MapArea area)
Sets the area in which the ability is being used.

Parameters:
area - the area in which the ability is being used

toString

public java.lang.String toString()
Returns a string representation of this ability event. The format of the string is AbilityEvent[team=...;ability=...].

Overrides:
toString in class java.util.EventObject
Returns:
a string representation of this ability event