Skip to content

Package: IHTPlayerBuilder

IHTPlayerBuilder

Coverage

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