Skip to content

Package: VierGewinntGameBuilder

VierGewinntGameBuilder

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.GameBuilder;
22: import de.fhdw.gaming.core.domain.GameException;
23: import de.fhdw.gaming.core.domain.ObserverFactoryProvider;
24:
25: /**
26: * A builder which allows to create a Vier Gewinnt game.
27: */
28: public interface VierGewinntGameBuilder extends GameBuilder {
29:
30: /**
31: * The default number of columns.
32: */
33: int DEFAULT_COLUMN_SIZE = 7;
34:
35: /**
36: * The default number of rows.
37: */
38: int DEFAULT_ROW_SIZE = 6;
39:
40: /**
41: * Creates an {@link VierGewinntPlayerBuilder} which allows to create and add a
42: * player to the game together with her strategy.
43: */
44: VierGewinntPlayerBuilder createPlayerBuilder();
45:
46: /**
47: * Adds a player builder and the corresponding strategy.
48: *
49: * @param playerBuilder The builder player used for creating the player.
50: * @param strategy The player's strategy.
51: * @throws GameException if adding the player is not allowed by the rules of the
52: * game.
53: */
54: VierGewinntGameBuilder addPlayerBuilder(VierGewinntPlayerBuilder playerBuilder, VierGewinntStrategy strategy)
55: throws GameException;
56:
57: /**
58: * Changes the columnSize to the parameter.
59: * @param columnSize
60: * @return
61: */
62: VierGewinntGameBuilder changeColumnSize(int columnSize);
63:
64: /**
65: * Changes the rowSize to the parameter.
66: * @param rowSize
67: * @return
68: */
69: VierGewinntGameBuilder changeRowSize(int rowSize);
70:
71: /**
72: * Changes the {@link ObserverFactoryProvider}.
73: *
74: * @param newObserverFactoryProvider The new {@link ObserverFactoryProvider}.
75: * @return {@code this}
76: */
77: VierGewinntGameBuilder changeObserverFactoryProvider(ObserverFactoryProvider newObserverFactoryProvider);
78:
79: @Override
80: VierGewinntGame build(int id) throws GameException, InterruptedException;
81: }