Class TurnEvent
java.lang.Object
java.util.EventObject
be.belegkarnil.game.board.tak.event.TurnEvent
- 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 Actionis the chosen {#link Action}, what the currentPlayer's strategy playsfinal Playeris the first {link @Player} when the turn will start, the event is related to this playerfinal Gameis the {link @Game} related to this event (i.e.static final Actionis the static constant that represents there are no action (null)final Playeris the second/other/opponent {link @Player} when turn round will startfinal intis the identifier (counter) of the related round.final intis the identifier (counter) of the related turn.Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionConstructor that does not define a winner (GameEvent.NO_WINNER), designed for begin events.Constructor requires an action (NO_ACTION), designed for end events. -
Method Summary
Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
NO_ACTION
is the static constant that represents there are no action (null) -
current
is the first {link @Player} when the turn will start, the event is related to this player -
opponent
is the second/other/opponent {link @Player} when turn round will start -
round
public final int roundis the identifier (counter) of the related round. -
turn
public final int turnis the identifier (counter) of the related turn. -
action
is the chosen {#link Action}, what the currentPlayer's strategy plays -
game
is the {link @Game} related to this event (i.e. theGamethat generates the event)
-
-
Constructor Details
-
TurnEvent
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 eventcurrent- is the current player related to this eventopponent- is the second/other/opponent playerround- is the round identifier related to the eventturn- is the turn identifier related to the event- Throws:
IllegalArgumentException- if source is null
-
TurnEvent
Constructor requires an action (NO_ACTION), designed for end events.- Parameters:
game- the game related to the event, it's the source of the eventcurrent- is the current player related to this eventopponent- is the second/other/opponent playerround- is the round identifier related to the eventturn- is the turn identifier related to the eventaction- is the action taken by the current player orNO_ACTION- Throws:
IllegalArgumentException- if source is null
-