Skip to contentMethod: computeNextMove(int, IHTPlayer, IHTState)
      1: package de.fhdw.gaming.ipspiel23.ht.strategy.impl.tails;
2: 
3: import java.util.Optional;
4: 
5: import de.fhdw.gaming.core.domain.GameException;
6: import de.fhdw.gaming.ipspiel23.ht.domain.IHTPlayer;
7: import de.fhdw.gaming.ipspiel23.ht.domain.IHTState;
8: import de.fhdw.gaming.ipspiel23.ht.moves.IHTMove;
9: import de.fhdw.gaming.ipspiel23.ht.moves.factory.IHTMoveFactory;
10: import de.fhdw.gaming.ipspiel23.ht.strategy.impl.HTStrategy;
11: 
12: /**
13:  * Implements {@link HTStrategy} by always playing "tails".
14:  */
15: public class HTTailsStrategy extends HTStrategy {
16: 
17:     /**
18:      * Creates an {@link HTTailsStrategy}.
19:      * @param moveFactory The factory for creating HT moves.
20:      */
21:     protected HTTailsStrategy(final IHTMoveFactory moveFactory) {
22:         super(moveFactory);
23:     }
24: 
25:     @Override
26:     public Optional<IHTMove> computeNextMove(final int gameId, final IHTPlayer player, final IHTState state)
27:             throws GameException, InterruptedException {
28:         return Optional.of(getMoveFactory().createTailsMove());
29:     }
30: }