Skip to content

Package: VierGewinntPlayerBuilder

VierGewinntPlayerBuilder

Coverage

1: /*
2: * Copyright © 2021 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of ipspiel21-tictactoe-core.
5: *
6: * ipspiel21-tictactoe-core is free software: you can redistribute it and/or modify it under
7: * the terms of the GNU General Public License as published by the Free Software
8: * Foundation, either version 3 of the License, or (at your option) any later
9: * version.
10: *
11: * ipspiel21-tictactoe-core is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14: * details.
15: *
16: * You should have received a copy of the GNU General Public License along with
17: * ipspiel21-tictactoe-core. If not, see <http://www.gnu.org/licenses/>.
18: */
19: package de.fhdw.gaming.ipspiel21.viergewinnt.core.domain;
20:
21: import de.fhdw.gaming.core.domain.GameException;
22:
23: /**
24: * A builder which allows to create a VierGewinnt player.
25: */
26: public interface VierGewinntPlayerBuilder {
27:
28: /**
29: * Changes the name of the player.
30: * <p>
31: * There is no default.
32: *
33: * @param newName The name of the player.
34: * @return {@code this}
35: */
36: VierGewinntPlayerBuilder changeName(String newName);
37:
38: /**
39: * Changes if the next build player will be yellow as color or not.
40: *
41: * @param yellow
42: * @return
43: */
44: VierGewinntPlayerBuilder changeUsingYellow(boolean yellow);
45:
46: /**
47: * Will the next build player be using yellow?
48: * @return true if the playerBuilder currently will build yellow-using players.
49: */
50: boolean isUsingYellow();
51:
52: /**
53: * Builds the player.
54: *
55: * @param state The VierGewinnt game state.
56: * @return The VierGewinnt player.
57: * @throws GameException if creating the player is not allowed by the rules of
58: * the game.
59: */
60: VierGewinntPlayer build(VierGewinntState state) throws GameException;
61: }