Skip to content

Package: HTEdgeStrategy

HTEdgeStrategy

nameinstructionbranchcomplexitylinemethod
HTEdgeStrategy(IHTMoveFactory)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
computeNextMove(int, IHTPlayer, IHTState)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: package de.fhdw.gaming.ipspiel23.ht.strategy.impl.edge;
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: import de.fhdw.gaming.ipspiel23.ht.strategy.impl.heads.HTHeadsStrategy;
12:
13: /**
14: * Implements {@link HTStrategy} by always playing "edge".
15: */
16: public class HTEdgeStrategy extends HTStrategy {
17:
18: /**
19: * Creates an {@link HTHeadsStrategy}.
20: * @param moveFactory The factory for creating HT moves.
21: */
22: protected HTEdgeStrategy(final IHTMoveFactory moveFactory) {
23: super(moveFactory);
24: }
25:
26: @Override
27: public Optional<IHTMove> computeNextMove(final int gameId, final IHTPlayer player, final IHTState state)
28: throws GameException, InterruptedException {
29: return Optional.of(getMoveFactory().createEdgeMove());
30: }
31: }