Skip to content

Method: toString()

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: }