Skip to content

Package: KopfundZahlGameBuilder

KopfundZahlGameBuilder

Coverage

1: package de.fhdw.gaming.ipspiel22.kopfundzahl.domain;
2:
3: import de.fhdw.gaming.core.domain.GameBuilder;
4: import de.fhdw.gaming.core.domain.GameException;
5: import de.fhdw.gaming.core.domain.ObserverFactoryProvider;
6:
7: /**
8: * A builder which allows to create a Head and Tail game.
9: */
10: public interface KopfundZahlGameBuilder extends GameBuilder {
11:
12: /**
13: * Creates an {@link KopfundZahlPlayerBuilder} which allows to create and add a player to the game together with
14: * their
15: * strategy.
16: */
17: KopfundZahlPlayerBuilder createPlayerBuilder();
18:
19: /**
20: * Adds a player and her corresponding strategy.
21: *
22: * @param player The player.
23: * @param strategy The player's strategy.
24: * @throws GameException if adding the player is not allowed by the rules of the game.
25: */
26: KopfundZahlGameBuilder addPlayer(KopfundZahlPlayer player,
27: KopfundZahlStrategy strategy) throws GameException;
28:
29: /**
30: * Changes the {@link ObserverFactoryProvider}.
31: *
32: * @param newObserverFactoryProvider The new {@link ObserverFactoryProvider}.
33: * @return {@code this}
34: */
35:
36: KopfundZahlGameBuilder changeObserverFactoryProvider(ObserverFactoryProvider newObserverFactoryProvider);
37:
38: @Override
39: KopfundZahlGame build(int id) throws GameException, InterruptedException;
40: }