Skip to content

Method: changeName(String)

1: package de.fhdw.gaming.ipspiel21.viergewinnt.core.domain.impl;
2:
3: import de.fhdw.gaming.core.domain.GameException;
4: import de.fhdw.gaming.ipspiel21.viergewinnt.core.domain.VierGewinntPlayer;
5: import de.fhdw.gaming.ipspiel21.viergewinnt.core.domain.VierGewinntPlayerBuilder;
6: import de.fhdw.gaming.ipspiel21.viergewinnt.core.domain.VierGewinntState;
7:
8: /**
9: * Implementation of a VierGewinntPlayer. This Class represent a VierGewinntPlayer.
10: */
11: public class VierGewinntPlayerBuilderImpl implements VierGewinntPlayerBuilder {
12:
13: /**
14: * The Name of a Player.
15: */
16: private String name;
17: /**
18: * The Colour of which token a player is using.
19: */
20: private boolean yellow;
21:
22: @Override
23: public VierGewinntPlayerBuilder changeName(final String newName) {
24: this.name = newName;
25: return this;
26: }
27:
28: @Override
29: public VierGewinntPlayerBuilder changeUsingYellow(final boolean usingYellow) {
30: this.yellow = usingYellow;
31: return this;
32: }
33:
34: @Override
35: public boolean isUsingYellow() {
36: return this.yellow;
37: }
38:
39: @Override
40: public VierGewinntPlayer build(final VierGewinntState state) throws GameException {
41:
42: return new VierGewinntPlayerImpl(state, this.name, this.yellow);
43: }
44:
45: }