Skip to content

Package: SspPlayerBuilder

SspPlayerBuilder

Coverage

1: /*
2: * Copyright © 2021-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of ipspiel23-Ssp.
5: *
6: * Ipspiel23-Ssp 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-Ssp 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-Ssp. If not, see
14: * <http://www.gnu.org/licenses/>.
15: */
16: package de.fhdw.gaming.ipspiel23.ssp.domain;
17:
18: import de.fhdw.gaming.core.domain.GameException;
19: import de.fhdw.gaming.ipspiel23.ssp.domain.impl.outcomes.SspAnswer;
20:
21: import java.util.Map;
22:
23: /**
24: * A builder which allows to create a SSP player.
25: */
26: public interface SspPlayerBuilder {
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: SspPlayerBuilder 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: SspPlayerBuilder changePossibleOutcomes(Map<SspAnswer, Map<SspAnswer, Double>> possibleOutcomes);
47:
48: /**
49: * Builds the player.
50: *
51: * @return The Demo player.
52: * @throws GameException if creating the player is not allowed by the rules of the game.
53: */
54: SspPlayer build() throws GameException;
55: }