Skip to content

Package: SspGameBuilder

SspGameBuilder

Coverage

1: /*
2: * Copyright © 2021-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of ipspiel24-Ssp.
5: *
6: * Ipspiel24-Ssp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
7: * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
8: * version.
9: *
10: * Ipspiel24-Ssp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
11: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public License along with ipspiel24-Ssp. If not, see
14: * <http://www.gnu.org/licenses/>.
15: */
16: package de.fhdw.gaming.ipspiel24.ssp.domain;
17:
18: import java.util.List;
19:
20: import de.fhdw.gaming.core.domain.Game;
21: import de.fhdw.gaming.core.domain.GameBuilder;
22: import de.fhdw.gaming.core.domain.GameException;
23: import de.fhdw.gaming.core.domain.Observer;
24: import de.fhdw.gaming.ipspiel24.ssp.moves.SspMove;
25:
26: /**
27: * A builder which allows to create a Ssp game.
28: */
29: public interface SspGameBuilder extends GameBuilder {
30:
31: /**
32: * Creates an {@link SspPlayerBuilder} which allows to create and add a player to the game together with her
33: * strategy.
34: */
35: SspPlayerBuilder createPlayerBuilder();
36:
37: /**
38: * Adds a player and her corresponding strategy.
39: *
40: * @param player The player.
41: * @param strategy The player's strategy.
42: * @throws GameException if adding the player is not allowed by the rules of the game.
43: */
44: SspGameBuilder addPlayer(SspPlayer player, SspStrategy strategy) throws GameException;
45:
46: @Override
47: SspGameBuilder addObservers(List<Observer> newObservers);
48:
49: @Override
50: Game<SspPlayer, SspState, SspMove, SspStrategy> build(int id) throws GameException, InterruptedException;
51: }