Skip to content

Package: SspPlayer

SspPlayer

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.Player;
19: import de.fhdw.gaming.ipspiel23.ssp.domain.impl.outcomes.SspAnswer;
20:
21: import java.util.Map;
22: import java.util.Optional;
23:
24: /**
25: * Provides a player interface for SSP-Game.
26: *
27: * @author DW
28: *
29: */
30: public interface SspPlayer extends Player<SspPlayer> {
31:
32: /**
33: * Returns the possible outcomes of this player. The key for the first-level map is the answer of the first player,
34: * the key for the second-level map is the answer of the second player.
35: */
36: Map<SspAnswer, Map<SspAnswer, Double>> getPossibleOutcomes();
37:
38: /**
39: * Returns the answer of this player.
40: */
41: Optional<SspAnswer> getAnswer();
42:
43: /**
44: * Sets the answer of this player.
45: *
46: * @param newAnswer The answer to set. {@code true} means "yes", {@code false} means "no"
47: * @throws IllegalStateException if an answer has already been set.
48: */
49: void setAnswer(SspAnswer newAnswer);
50:
51: @Override
52: SspPlayer deepCopy();
53: }