Skip to content

Package: DemoGameBuilder

DemoGameBuilder

Coverage

1: /*
2: * Copyright © 2021-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of ipspiel23-demo.
5: *
6: * Ipspiel23-demo 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: * Ipspiel23-demo 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 ipspiel23-demo. If not, see
14: * <http://www.gnu.org/licenses/>.
15: */
16: package de.fhdw.gaming.ipspiel23.demo.domain;
17:
18: import de.fhdw.gaming.core.domain.GameBuilder;
19: import de.fhdw.gaming.core.domain.GameException;
20: import de.fhdw.gaming.core.domain.ObserverFactoryProvider;
21:
22: /**
23: * A builder which allows to create a Demo game.
24: */
25: public interface DemoGameBuilder extends GameBuilder {
26:
27: /**
28: * Creates an {@link DemoPlayerBuilder} which allows to create and add a player to the game together with her
29: * strategy.
30: */
31: DemoPlayerBuilder createPlayerBuilder();
32:
33: /**
34: * Adds a player and her corresponding strategy.
35: *
36: * @param player The player.
37: * @param strategy The player's strategy.
38: * @throws GameException if adding the player is not allowed by the rules of the game.
39: */
40: DemoGameBuilder addPlayer(DemoPlayer player, DemoStrategy strategy) throws GameException;
41:
42: /**
43: * Changes the {@link ObserverFactoryProvider}.
44: *
45: * @param newObserverFactoryProvider The new {@link ObserverFactoryProvider}.
46: * @return {@code this}
47: */
48: DemoGameBuilder changeObserverFactoryProvider(ObserverFactoryProvider newObserverFactoryProvider);
49:
50: @Override
51: DemoGame build(int id) throws GameException, InterruptedException;
52: }