Skip to content

Package: IKopplung

IKopplung

Coverage

1: package de.fhdw.gaming.ipspiel23.gst.domain;
2:
3: import java.util.Collection;
4: import java.util.Optional;
5:
6: import de.fhdw.gaming.core.domain.Move;
7: import de.fhdw.gaming.core.domain.Player;
8: import de.fhdw.gaming.core.domain.State;
9:
10: /**
11: * The Kopplung interface needed for the use of the search tree Project.
12: *
13: * @param <P> The type of player in the game.
14: * @param <S> The type of state in the game.
15: */
16: public interface IKopplung<P extends Player<P>, S extends State<P, S>> {
17:
18: /**
19: * Retrieves the collection of possible moves in the given game state.
20: *
21: * @param state The current game state.
22: * @return An optional containing the collection of possible moves, or empty if no moves are possible.
23: */
24: Optional<Collection<Move<P, S>>> getPossibleMoves(S state);
25:
26: /**
27: * Evaluates the given game state and returns a score indicating the state's desirability.
28: *
29: * @param state The game state to evaluate.
30: * @return An optional containing the evaluation score, or empty if the evaluation is not possible.
31: */
32: Optional<Integer> evalState(S state);
33:
34: /**
35: * Retrieves the current player in the given game state.
36: *
37: * @param state The current game state.
38: * @return An optional containing the current player, or empty if the current player cannot be determined.
39: */
40: Optional<P> getCurrentPlayer(S state);
41:
42: /** CHecks iff the given game state is game-over.
43: *
44: * @param state The current game state.
45: * @return An optional containing a Boolean, True iff game is over.
46: */
47: Optional<Boolean> getIsGameOver(S state);
48: }