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
Raw Normal View History

2019-08-07 18:54:00 +02:00
package dev.kske.chess.event;
import dev.kske.chess.board.BoardState;
2019-08-07 18:54:00 +02:00
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
2019-08-07 18:54:00 +02:00
*/
public class MoveEvent implements Event<Move> {
private final Move move;
private final BoardState boardState;
2019-08-07 18:54:00 +02:00
2020-01-19 22:12:33 +01:00
/**
* 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) {
2019-08-07 18:54:00 +02:00
this.move = move;
this.boardState = boardState;
2019-08-07 18:54:00 +02:00
}
@Override
public Move getData() { return move; }
2020-01-19 22:12:33 +01:00
/**
* @return the state of the board after the move
*/
public BoardState getBoardState() { return boardState; }
2019-08-07 18:54:00 +02:00
}