Skip to content

Package: OthelloState

OthelloState

Coverage

1: /*
2: * Copyright © 2020 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of othello-core.
5: *
6: * Othello-core is free software: you can redistribute it and/or modify it under
7: * the terms of the GNU General Public License as published by the Free Software
8: * Foundation, either version 3 of the License, or (at your option) any later
9: * version.
10: *
11: * Othello-core is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14: * details.
15: *
16: * You should have received a copy of the GNU General Public License along with
17: * othello-core. If not, see <http://www.gnu.org/licenses/>.
18: */
19: package de.fhdw.gaming.othello.core.domain;
20:
21: import de.fhdw.gaming.core.domain.State;
22:
23: /**
24: * Represents the state of an Othello game.
25: */
26: public interface OthelloState extends State<OthelloPlayer, OthelloState> {
27:
28: /**
29: * Returns the board.
30: */
31: OthelloBoard getBoard();
32:
33: /**
34: * Returns the player using black tokens.
35: */
36: OthelloPlayer getBlackPlayer();
37:
38: /**
39: * Returns the player using white tokens..
40: */
41: OthelloPlayer getWhitePlayer();
42:
43: /**
44: * Returns the currently active player, i.e. the player that needs to make the next move.
45: */
46: OthelloPlayer getCurrentPlayer();
47:
48: /**
49: * Indicates that a move has been completed.
50: *
51: * @param skipMove {@code true} if the last move was a skip move, else {@code false}.
52: */
53: void moveCompleted(boolean skipMove);
54:
55: /**
56: * Returns the number of consecutive skip moves.
57: */
58: int getNumberOfConsecutiveSkips();
59: }