Skip to content

Package: DemoPlayerBuilder

DemoPlayerBuilder

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 java.util.Map;
19:
20: import de.fhdw.gaming.core.domain.GameException;
21:
22: /**
23: * A builder which allows to create a Demo player.
24: */
25: public interface DemoPlayerBuilder {
26:
27: /**
28: * Changes the name of the player.
29: * <p>
30: * There is no default.
31: *
32: * @param newName The name of the player.
33: * @return {@code this}
34: */
35: DemoPlayerBuilder changeName(String newName);
36:
37: /**
38: * Changes the possible outcomes of the player.
39: * <p>
40: * There is no default.
41: *
42: * @param possibleOutcomes The possible outcomes of the player. The key for the first-level map is the answer of the
43: * first player, the key for the second-level map is the answer of the second player.
44: */
45: DemoPlayerBuilder changePossibleOutcomes(Map<Boolean, Map<Boolean, Double>> possibleOutcomes);
46:
47: /**
48: * Builds the player.
49: *
50: * @return The Demo player.
51: * @throws GameException if creating the player is not allowed by the rules of the game.
52: */
53: DemoPlayer build() throws GameException;
54: }