Class GameEvent
java.lang.Object
java.util.EventObject
be.belegkarnil.game.board.tak.event.GameEvent
- All Implemented Interfaces:
Serializable
This event is used to notify interested parties that the game state is changed during a
Game.- Author:
- Belegkarnil
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Playeris the first {link @Player} when the game will startfinal Gameis the {link @Game} related to this event (i.e.static Playeris a static constant with null value meaning that there are not yet a winnerfinal Playeris the second/other/opponent {link @Player} when the game will startfinal PlayerFields inherited from class java.util.EventObject
source -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
NO_WINNER
is a static constant with null value meaning that there are not yet a winner -
winner
-
firstPlayer
is the first {link @Player} when the game will start -
secondPlayer
is the second/other/opponent {link @Player} when the game will start -
game
is the {link @Game} related to this event (i.e. theGamethat generates the event)
-
-
Constructor Details
-
GameEvent
Constructor that does not define a winner (NO_WINNER), designed for begin events.- Parameters:
game- the game related to the event, it's the source of the eventfirstPlayer- is the first player to play when the game will startsecondPlayer- is the second/other/opponent player to play when the game will start- Throws:
IllegalArgumentException- if source is null
-
GameEvent
Constructor requires a winner (NO_WINNER), designed for end events.- Parameters:
game- the game related to the event, it's the source of the eventfirstPlayer- is the first player to play when the game will startsecondPlayer- is the second/other/opponent player to play when the game will startwinner- is the player (first/second) who win theGameorNO_WINNER- Throws:
IllegalArgumentException- if source is null
-