Class MisdesignEvent
java.lang.Object
java.util.EventObject
be.belegkarnil.game.board.tak.event.MisdesignEvent
- All Implemented Interfaces:
Serializable
This event is used to notify interested parties that an error of design, conception or implementation has occurred during a
Game.- Author:
- Belegkarnil
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Boardis the board state when the event occursfinal Exceptionis the exception generated when the player tried to play (orNO_EXCEPTION)static final Exceptionis the static constant that represents there are no exception (null)static final Pieceis the static constant that represents there are no piece (null)static final Pointis the static constant that represents there are no position (null)final Pieceis the piece that the player tried to play (orNO_PIECE)final Playeris the {link @Player} that generate the eventfinal Pointis the position at which the player tried to play a piece (orNO_POSITION)Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionMisdesignEvent(Player player, Board board) Constructor designed for a timeout, only a board and a player, no piece are playedMisdesignEvent(Player player, Board board, Piece piece) Constructor designed for a cheat event, the player uses aPiecehe does not haveMisdesignEvent(Player player, Board board, Piece piece, Point position) Constructor designed for an invalid position.MisdesignEvent(Player player, Board board, Exception exception) Constructor designed for exceptions, only a board, a player, and the generated exception. -
Method Summary
Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
NO_EXCEPTION
is the static constant that represents there are no exception (null) -
NO_PIECE
is the static constant that represents there are no piece (null) -
NO_POSITION
is the static constant that represents there are no position (null) -
player
is the {link @Player} that generate the event -
board
is the board state when the event occurs -
piece
is the piece that the player tried to play (orNO_PIECE) -
position
is the position at which the player tried to play a piece (orNO_POSITION) -
exception
is the exception generated when the player tried to play (orNO_EXCEPTION)
-
-
Constructor Details
-
MisdesignEvent
Constructor designed for a timeout, only a board and a player, no piece are played- Parameters:
player- is the player who has and generates a misconception eventboard- is the board related to the current game status
-
MisdesignEvent
Constructor designed for a cheat event, the player uses aPiecehe does not have- Parameters:
player- is the player who has and generates a misconception eventboard- is the board related to the current game statuspiece- is the piece that te player tried to play (orNO_PIECEis no piece where played)
-
MisdesignEvent
Constructor designed for an invalid position. The player try to play on anotherPiece, out of theBoard, not adjacent to aPiece, or the adjacent colors does not match.- Parameters:
player- is the player who has and generates a misconception eventboard- is the board related to the current game statuspiece- is the piece that te player tried to play (orNO_PIECEis no piece where played)position- is the position at which te player tried to play (orNO_POSITIONis there are not position)
-
MisdesignEvent
Constructor designed for exceptions, only a board, a player, and the generated exception.- Parameters:
player- is the player who has and generates a misconception eventboard- is the board related to the current game statusexception- is exception generated by theStrategyimplementation (orNO_EXCEPTIONif there are no exception)
-