Skip to contentPackage: MinimaxStrategy
MinimaxStrategy
Coverage
      1: package de.fhdw.gaming.ipspiel24.minimax;
2: 
3: import java.util.List;
4: 
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: import de.fhdw.gaming.core.domain.Strategy;
9: 
10: /**
11:  * Interface for Game Strategy to use if minimax should be implemented.
12:  *
13:  * @param <P> Player
14:  * @param <S> State
15:  * @param <M> Move
16:  */
17: public interface MinimaxStrategy<P extends Player<P>, S extends State<P, S>, M extends Move<P, S>>
18:         extends Strategy<P, S, M> {
19: 
20:     /**
21:      * returns possible (and legal) moves for a given game state.
22:      * 
23:      * @param state State of the game at the current time
24:      */
25:     List<M> getPossibleMoves(S state);
26: 
27:     /**
28:      * returns a score for a given gamestate.
29:      *
30:      * @param state  current state of the game
31:      * @param player the player that is using minimax.
32:      * @param depth  depth of gametree.
33:      */
34:     int evaluate(S state, P player, int depth);
35: 
36:     /**
37:      * returns opponent of current player of gamestate.
38:      *
39:      * @param state state of the game
40:      */
41:     P getOpponent(S state);
42: 
43: }