Skip to content

Package: IDilemmaPlayerBuilder

IDilemmaPlayerBuilder

Coverage

1: package de.fhdw.gaming.ipspiel23.dilemma.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 DilemmaPlayer.
9: */
10: public interface IDilemmaPlayerBuilder {
11:
12: /**
13: * Changes the name of the player.
14: * <p>
15: * There is no default.
16: * </p>
17: *
18: * @param newName The name of the player.
19: * @return {@code this}
20: */
21: IDilemmaPlayerBuilder changeName(String newName);
22:
23: /**
24: * Changes the possible outcomes of the player.
25: * <p>
26: * There is no default.
27: *
28: * @param possibleOutcomes The possible outcomes of the player. The key for the first-level map is the answer of the
29: * first player, the key for the second-level map is the answer of the second player.
30: */
31: IDilemmaPlayerBuilder changePossibleOutcomes(
32: Map<DilemmaAnswerType, Map<DilemmaAnswerType, Double>> possibleOutcomes);
33:
34: /**
35: * Builds the player.
36: *
37: * @return The Dilemma player.
38: * @throws GameException if creating the player is not allowed by the rules of the game.
39: */
40: IDilemmaPlayer build() throws GameException;
41: }