|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.EventObject
edu.uiuc.cs397rhc.game.GameEvent
edu.uiuc.cs397rhc.game.ScoreEvent
Fired when the score is updated for any reason. This class provides the both the list of scores and the team that scored, but the team is not always expected to be specified.
GameUtils,
Serialized Form| Field Summary |
|---|
| Fields inherited from class java.util.EventObject |
|---|
source |
| Constructor Summary | |
|---|---|
ScoreEvent(java.lang.Object source,
java.util.EnumMap<GameUtils.Team,java.lang.Integer> scores)
Constructs a score event with the specified scores, coming from the specified source. |
|
ScoreEvent(java.lang.Object source,
GameUtils.Team team,
java.util.EnumMap<GameUtils.Team,java.lang.Integer> scores)
Constructs a score event indicating that the specified team has scored. |
|
| Method Summary | |
|---|---|
java.util.EnumMap<GameUtils.Team,java.lang.Integer> |
getScores()
Returns the current scores for all teams. |
GameUtils.Team |
getTeam()
Returns the team that scored, if known. |
void |
setScores(java.util.EnumMap<GameUtils.Team,java.lang.Integer> scores)
Sets the list of scores for all teams. |
void |
setTeam(GameUtils.Team team)
Sets the team that has scored. |
java.lang.String |
toString()
Returns a string representation of this score 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 |
|---|
public ScoreEvent(java.lang.Object source,
java.util.EnumMap<GameUtils.Team,java.lang.Integer> scores)
source - the source of this eventscores - the current scores for all teams
public ScoreEvent(java.lang.Object source,
GameUtils.Team team,
java.util.EnumMap<GameUtils.Team,java.lang.Integer> scores)
source - the source of this eventteam - the team that has scoredscores - the current scores for all teams| Method Detail |
|---|
public GameUtils.Team getTeam()
null if the team is not
knownpublic java.util.EnumMap<GameUtils.Team,java.lang.Integer> getScores()
public void setTeam(GameUtils.Team team)
team - the team that has scoredpublic void setScores(java.util.EnumMap<GameUtils.Team,java.lang.Integer> scores)
scores - the list of scores for all teamspublic java.lang.String toString()
ScoreEvent[team=...;scores={...}].
toString in class java.util.EventObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||