Skip to content

Package: FGMoveGeneratorImpl

FGMoveGeneratorImpl

nameinstructionbranchcomplexitylinemethod
FGMoveGeneratorImpl()
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
generate(FGPlayer, FGState)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1:
2: package de.fhdw.gaming.ipspiel24.fg.domain.impl;
3:
4: import java.util.Optional;
5:
6: import de.fhdw.gaming.ipspiel24.fg.domain.FGMoveGenerator;
7: import de.fhdw.gaming.ipspiel24.fg.domain.FGPlayer;
8: import de.fhdw.gaming.ipspiel24.fg.domain.FGState;
9: import de.fhdw.gaming.ipspiel24.fg.moves.FGMove;
10: import de.fhdw.gaming.ipspiel24.fg.moves.factory.FGMoveFactory;
11: import de.fhdw.gaming.ipspiel24.fg.moves.impl.FGDefaultMoveFactory;
12:
13: /**
14: * Implements the {@link FGMoveGenerator} interface.
15: */
16: final class FGMoveGeneratorImpl implements FGMoveGenerator {
17:
18: /**
19: * The move factory.
20: */
21: private final FGMoveFactory moveFactory = new FGDefaultMoveFactory();
22:
23: @Override
24: public Optional<FGMove> generate(final FGPlayer player, final FGState state) {
25: // choose "no" to punish lame strategies
26: return Optional.of(this.moveFactory.createFootballMove());
27: }
28: }