Skip to content

Package: MinMaxGame

MinMaxGame

Coverage

1: package de.fhdw.gaming.ipspiel22.searchtree.domain;
2: import java.util.List;
3:
4: import de.fhdw.gaming.core.domain.GameException;
5: import de.fhdw.gaming.core.domain.Move;
6: import de.fhdw.gaming.core.domain.Player;
7: import de.fhdw.gaming.core.domain.State;
8: /**
9: * Game interface for the MinMax algorithm.
10: *
11: * @param <P> The type of player.
12: * @param <S> The type of state.
13: * @param <M> The type of move.
14: */
15: public interface MinMaxGame<P extends Player<P>, S extends State<P, S>, M extends Move<P, S>> {
16:
17: /**
18: * Function which evaluate the current state of the game into a double for calculations.
19: *
20: * @return a double value for the current game state.
21: */
22: double evaluateStateful();
23: /**
24: * Function to check if the game is over in this current state.
25: *
26: * @return Boolean (gameOver - true / gameIsPlaying - false).
27: */
28: boolean isGameOver();
29: /**
30: * Function to get all possible moves for a player.
31: */
32: List<M> getPossibleMoves();
33: /**
34: * Execute a move in the game.
35: *
36: * @param move the move which should be execute.
37: */
38: void commitMove(M move) throws GameException;
39: /**
40: * Undo a move in the game.
41: *
42: * @param move the move which should be undo.
43: */
44: void rollbackMove(M move);
45: }