Skip to content

Package: FGFootballStrategy

FGFootballStrategy

nameinstructionbranchcomplexitylinemethod
FGFootballStrategy(FGMoveFactory)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
computeNextMove(int, FGPlayer, FGState, long)
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%
toString()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1:
2: package de.fhdw.gaming.ipspiel24.fg.strategy;
3:
4: import java.util.Optional;
5:
6: import de.fhdw.gaming.ipspiel24.fg.domain.FGPlayer;
7: import de.fhdw.gaming.ipspiel24.fg.domain.FGState;
8: import de.fhdw.gaming.ipspiel24.fg.domain.FGStrategy;
9: import de.fhdw.gaming.ipspiel24.fg.moves.FGMove;
10: import de.fhdw.gaming.ipspiel24.fg.moves.factory.FGMoveFactory;
11:
12: /**
13: * Implements {@link FGStrategy} by always saying "no".
14: */
15: public final class FGFootballStrategy implements FGStrategy {
16:
17: /**
18: * The factory for creating FG moves.
19: */
20: private final FGMoveFactory moveFactory;
21:
22: /**
23: * Creates an {@link FGFootballStrategy}.
24: *
25: * @param moveFactory The factory for creating FG moves.
26: */
27: FGFootballStrategy(final FGMoveFactory moveFactory) {
28: this.moveFactory = moveFactory;
29: }
30:
31: @Override
32: public Optional<FGMove> computeNextMove(
33: final int gameId,
34: final FGPlayer player,
35: final FGState state,
36: final long maxComputationTimePerMove) {
37: return Optional.of(this.moveFactory.createFootballMove());
38: }
39:
40: @Override
41: public String toString() {
42: return FGFootballStrategy.class.getSimpleName();
43: }
44: }