Skip to content

Package: GDPlayerBuilder

GDPlayerBuilder

Coverage

1: /*
2: * Copyright © 2021-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of ipspiel24-GD.
5: *
6: * ipspiel24-GD 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-GD 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-GD. If not, see
14: * <http://www.gnu.org/licenses/>.
15: */
16: package de.fhdw.gaming.GefangenenDilemma.domain;
17:
18: import java.util.Map;
19:
20: import de.fhdw.gaming.GefangenenDilemma.domain.impl.GDGameBuilderFactoryImpl;
21: import de.fhdw.gaming.core.domain.GameException;
22:
23: /**
24: * A builder which allows to create a Gefangenen-Dilemma player.
25: */
26: public interface GDPlayerBuilder {
27:
28: /**
29: * Changes the name of the player.
30: * <p>
31: * There is no default.
32: *
33: * @param newName The name of the player.
34: * @return {@code this}
35: */
36: GDPlayerBuilder changeName(String newName);
37:
38: /**
39: * Changes the possible outcomes of the player.
40: * <p>
41: * There is no default.
42: *
43: * @param possibleOutcomes The possible outcomes of the player. The key for the first-level map is the answer of the
44: * first player, the key for the second-level map is the answer of the second player.
45: */
46: GDPlayerBuilder changePossibleOutcomes(
47: @SuppressWarnings("exports") Map<GDGameBuilderFactoryImpl.MOVES,
48: Map<GDGameBuilderFactoryImpl.MOVES, Double>> possibleOutcomes);
49:
50: /**
51: * Builds the player.
52: *
53: * @return The Gefangenen-Dilemma player.
54: * @throws GameException if creating the player is not allowed by the rules of the game.
55: */
56: GDPlayer build() throws GameException;
57: }