This repository has been archived on 2021-02-18. You can view files and clone it, but cannot push or open issues or pull requests.
chess/src/main/java/dev/kske/chess/event/MoveEvent.java

38 lines
920 B
Java

package dev.kske.chess.event;
import dev.kske.chess.board.BoardState;
import dev.kske.chess.board.Move;
/**
* Project: <strong>Chess</strong><br>
* File: <strong>MoveEvent.java</strong><br>
* Created: <strong>7 Aug 2019</strong><br>
*
* @since Chess v0.4-alpha
* @author Kai S. K. Engelbart
*/
public class MoveEvent implements Event<Move> {
private final Move move;
private final BoardState boardState;
/**
* Creates an instance of {@link MoveEvent}.
*
* @param move the move by which the event was triggered
* @param boardState the state of the board after the move
*/
public MoveEvent(Move move, BoardState boardState) {
this.move = move;
this.boardState = boardState;
}
@Override
public Move getData() { return move; }
/**
* @return the state of the board after the move
*/
public BoardState getBoardState() { return boardState; }
}