Skip to content

Package: GDPlayer

GDPlayer

Coverage

1: package de.fhdw.gaming.ipspiel22.gefangenenDilemma.domain;
2:
3: import java.util.Map;
4: import java.util.Optional;
5:
6: import de.fhdw.gaming.core.domain.Player;
7:
8: /**
9: * Represents a Gefangenen Dilemma player.
10: */
11: public interface GDPlayer extends Player<GDPlayer> {
12: /**
13: * Returns the possible outcomes of this player. The key for the first-level map is the answer of the first player,
14: * the key for the second-level map is the answer of the second player.
15: */
16: Map<Boolean, Map<Boolean, Double>> getPossibleOutcomes();
17:
18: /**
19: * Returns the answer of this player. {@code true} means "staying quiet", {@code false} means "making a statement".
20: */
21: Optional<Boolean> getAnswer();
22:
23: /**
24: * Sets the answer of this player.
25: *
26: * @param newAnswer The answer to set. {@code true} means "staying quiet", {@code false} means "making a statement".
27: * @throws IllegalStateException if an answer has already been set.
28: */
29: void setAnswer(boolean newAnswer);
30: }