Skip to contentPackage: VierConnectsPlayerBuilder
VierConnectsPlayerBuilder
Coverage
      1: /*
2:  * Copyright © 2021-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3:  *
4:  * This file is part of ipspiel24-VierConnects-core.
5:  *
6:  * ipspiel24-VierConnects-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:  * ipspiel24-VierConnects-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:  * ipspiel24-VierConnects-core. If not, see <http://www.gnu.org/licenses/>.
18:  */
19: package de.fhdw.gaming.ipspiel24.VierConnects.core.domain;
20: 
21: import de.fhdw.gaming.core.domain.GameException;
22: 
23: /**
24:  * A builder which allows to create a Vier Connects player.
25:  */
26: public interface VierConnectsPlayerBuilder {
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:     VierConnectsPlayerBuilder changeName(String newName);
37: 
38:     /**
39:      * Determines whether the player is using crosses or noughts.
40:      * <p>
41:      * The default value if not called is {@code true}.
42:      *
43:      * @param newUsingCrosses If {@code true}, the player will be using crosses, else she will be using noughts.
44:      * @return {@code this}
45:      */
46:     VierConnectsPlayerBuilder changeUsingCrosses(boolean newUsingCrosses);
47: 
48:     /**
49:      * Returns {@code true} if this player builder uses crosses, and {@code false} if she uses noughts.
50:      */
51:     boolean isUsingCrosses();
52: 
53:     /**
54:      * Builds the player.
55:      *
56:      * @return The Vier Connects player.
57:      * @throws GameException if creating the player is not allowed by the rules of the game.
58:      */
59:     VierConnectsPlayer build() throws GameException;
60: }