Skip to content

Package: IDilemmaGameBuilder

IDilemmaGameBuilder

Coverage

1: package de.fhdw.gaming.ipspiel23.dilemma.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 Dilemma game.
9: */
10: public interface IDilemmaGameBuilder extends GameBuilder {
11:
12: /**
13: * The default outcome for Schweigen/Schweigen.
14: */
15: int DEFAULT_OUTCOME_COOPERATE_COOPERATE = -1;
16: /**
17: * The default outcome for Schweigen/Aussagen.
18: */
19: int DEFAULT_OUTCOME_COOPERATE_DEFECT = -10;
20: /**
21: * The default outcome for Aussagen/Schweigen.
22: */
23: int DEFAULT_OUTCOME_DEFECT_COOPERATE = 0;
24: /**
25: * The default outcome for Aussagen/Aussagen.
26: */
27: int DEFAULT_OUTCOME_DEFECT_DEFECT = -8;
28: /**
29: * The default computation time in seconds.
30: */
31: int DEFAULT_COMPUTATION_TIME = 5;
32:
33: /**
34: * Creates an {@link IDilemmaPlayerBuilder} which allows to create and add a player to the game together with her
35: * strategy.
36: */
37: IDilemmaPlayerBuilder createPlayerBuilder();
38:
39: /**
40: * Adds a player and her corresponding strategy.
41: *
42: * @param player The player.
43: * @param strategy The player's strategy.
44: * @throws GameException if adding the player is not allowed by the rules of the game.
45: */
46: IDilemmaGameBuilder addPlayer(IDilemmaPlayer player, IDilemmaStrategy strategy) throws GameException;
47:
48: /**
49: * Changes the {@link ObserverFactoryProvider}.
50: *
51: * @param newObserverFactoryProvider The new {@link ObserverFactoryProvider}.
52: * @return {@code this}
53: */
54: IDilemmaGameBuilder changeObserverFactoryProvider(ObserverFactoryProvider newObserverFactoryProvider);
55:
56: @Override
57: IDilemmaGameBuilder changeMaximumComputationTimePerMove(int newMaxComputationTimePerMove);
58:
59: @Override
60: IDilemmaGame build(int id) throws GameException, InterruptedException;
61: }