Skip to content

Package: GDPlayerBuilder

GDPlayerBuilder

Coverage

1: package de.fhdw.gaming.ipspiel22.gefangenenDilemma.domain;
2:
3: import java.util.Map;
4:
5: import de.fhdw.gaming.core.domain.GameException;
6:
7: /**
8: * A builder which allows to create a Gefangenen Dilemma player.
9: */
10: public interface GDPlayerBuilder {
11: /**
12: * Changes the name of the player.
13: * <p>
14: * There is no default.
15: *
16: * @param newName The name of the player.
17: * @return {@code this}
18: */
19: GDPlayerBuilder changeName(String newName);
20:
21: /**
22: * Changes the possible outcomes of the player.
23: * <p>
24: * There is no default.
25: *
26: * @param possibleOutcomes The possible outcomes of the player. The key for the first-level map is the answer of the
27: * first player, the key for the second-level map is the answer of the second player.
28: */
29: GDPlayerBuilder changePossibleOutcomes(Map<Boolean, Map<Boolean, Double>> possibleOutcomes);
30:
31: /**
32: * Builds the player.
33: *
34: * @return The Gefangenen Dilemma player.
35: * @throws GameException if creating the player is not allowed by the rules of the game.
36: */
37: GDPlayer build() throws GameException;
38: }