Class MisdesignEvent

java.lang.Object
java.util.EventObject
be.belegkarnil.game.board.tak.event.MisdesignEvent
All Implemented Interfaces:
Serializable

public class MisdesignEvent extends EventObject
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 Details

    • NO_EXCEPTION

      public static final Exception NO_EXCEPTION
      is the static constant that represents there are no exception (null)
    • NO_PIECE

      public static final Piece NO_PIECE
      is the static constant that represents there are no piece (null)
    • NO_POSITION

      public static final Point NO_POSITION
      is the static constant that represents there are no position (null)
    • player

      public final Player player
      is the {link @Player} that generate the event
    • board

      public final Board board
      is the board state when the event occurs
    • piece

      public final Piece piece
      is the piece that the player tried to play (or NO_PIECE)
    • position

      public final Point position
      is the position at which the player tried to play a piece (or NO_POSITION)
    • exception

      public final Exception exception
      is the exception generated when the player tried to play (or NO_EXCEPTION)
  • Constructor Details

    • MisdesignEvent

      public MisdesignEvent(Player player, Board board)
      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 event
      board - is the board related to the current game status
    • MisdesignEvent

      public MisdesignEvent(Player player, Board board, Piece piece)
      Constructor designed for a cheat event, the player uses a Piece he does not have
      Parameters:
      player - is the player who has and generates a misconception event
      board - is the board related to the current game status
      piece - is the piece that te player tried to play (or NO_PIECE is no piece where played)
    • MisdesignEvent

      public MisdesignEvent(Player player, Board board, Piece piece, Point position)
      Constructor designed for an invalid position. The player try to play on another Piece, out of the Board, not adjacent to a Piece, or the adjacent colors does not match.
      Parameters:
      player - is the player who has and generates a misconception event
      board - is the board related to the current game status
      piece - is the piece that te player tried to play (or NO_PIECE is no piece where played)
      position - is the position at which te player tried to play (or NO_POSITION is there are not position)
    • MisdesignEvent

      public MisdesignEvent(Player player, Board board, Exception exception)
      Constructor designed for exceptions, only a board, a player, and the generated exception.
      Parameters:
      player - is the player who has and generates a misconception event
      board - is the board related to the current game status
      exception - is exception generated by the Strategy implementation (or NO_EXCEPTION if there are no exception)