Class RoundEvent
java.lang.Object
java.util.EventObject
be.belegkarnil.game.board.spectrangle.event.RoundEvent
- All Implemented Interfaces:
Serializable
This event is used to notify interested parties that the turn state is changed during a
Game.- Author:
- Belegkarnil
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Gameis the {link @Game} related to this event (i.e.final Playeris the second/other/opponent {link @Player} when the round will startfinal intis the identifier (counter) of the related round.final Playeris the first {link @Player} when the round will startfinal Playeris the {link @Player} who win the current round during theGameorGameEvent.NO_WINNERFields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionRoundEvent(Game game, Player startPlayer, Player opponent, int round) Constructor that does not define a winner (GameEvent.NO_WINNER), designed for begin events.RoundEvent(Game game, Player startPlayer, Player opponent, int round, Player winner) Constructor requires a winner (GameEvent.NO_WINNER), designed for end events. -
Method Summary
Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
startPlayer
is the first {link @Player} when the round will start -
opponent
is the second/other/opponent {link @Player} when the round will start -
winner
is the {link @Player} who win the current round during theGameorGameEvent.NO_WINNER -
round
public final int roundis the identifier (counter) of the related round. -
game
is the {link @Game} related to this event (i.e. theGamethat generates the event)
-
-
Constructor Details
-
RoundEvent
Constructor that does not define a winner (GameEvent.NO_WINNER), designed for begin events.- Parameters:
game- the game related to the event, it's the source of the eventstartPlayer- is the first player to play when the round will startopponent- is the second/other/opponent player to play when the round will startround- is the round identifier related to the event- Throws:
IllegalArgumentException- if source is null
-
RoundEvent
Constructor requires a winner (GameEvent.NO_WINNER), designed for end events.- Parameters:
game- the game related to the event, it's the source of the eventstartPlayer- is the first player to play when the round will startopponent- is the second/other/opponent player to play when the round will startround- is the round identifier related to the eventwinner- is the player (first/second) who win theGameorGameEvent.NO_WINNER- Throws:
IllegalArgumentException- if source is null
-