Skip to content

Package: VGPlayerBuilder

VGPlayerBuilder

Coverage

1: package de.fhdw.gaming.ipspiel22.vierGewinnt.domain;
2:
3: import de.fhdw.gaming.core.domain.GameException;
4:
5: /**
6: * A builder which allows to create a Vier gewinnt player.
7: */
8: public interface VGPlayerBuilder {
9: /**
10: * Changes the name of the player.
11: * <p>
12: * There is no default.
13: *
14: * @param newName The name of the player.
15: * @return {@code this}
16: */
17: VGPlayerBuilder changeName(String newName);
18:
19: /**
20: * Determines whether the player is using red or yellow tokens.<
21: * <p>
22: * The default value if not called is {@code true}.
23: *
24: * @param newUsingRedChips If {@code true}, the player will be using red tokens, else she will be using yellow
25: * tokens.
26: * @return {@code this}
27: */
28: VGPlayerBuilder changeUsingRedChips(boolean newUsingRedChips);
29:
30: /**
31: * Returns {@code true} if this player builder uses the red tokens, and {@code false} if she uses the yellow
32: * tokens.
33: */
34: boolean isUsingRedChips();
35:
36: /**
37: * Builds the player.
38: *
39: * @return The Vier gewinnt player.
40: * @throws GameException if creating the player is not allowed by the rules of the game.
41: */
42: VGPlayer build() throws GameException;
43: }