Package: FGMoveGeneratorImpl
FGMoveGeneratorImpl
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FGMoveGeneratorImpl() |
|
|
|
|
|
||||||||||||||||||||
generate(FGPlayer, FGState) |
|
|
|
|
|
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: }