Skip to content

Package: KopfundZahlPlayer

KopfundZahlPlayer

Coverage

1: package de.fhdw.gaming.ipspiel22.kopfundzahl.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 player for the head and tail game.
10: */
11: public interface KopfundZahlPlayer extends Player<KopfundZahlPlayer> {
12:
13: /**
14: * Returns the possible outcomes of this player. The key for the first-level map is the answer of the first player,
15: * the key for the second-level map is the answer of the second player.
16: */
17: Map<Boolean, Map<Boolean, Double>> getPossibleOutcomes();
18:
19: /**
20: * Returns the answer of this player. {@code true} means "Head", {@code false} means "tail".
21: */
22: Optional<Boolean> getAnswer();
23:
24: /**
25: * Sets the answer of this player.
26: *
27: * @param newAnswer The answer to set. {@code true} means "Head", {@code false} means "tail".
28: * @throws IllegalStateException if an answer has already been set.
29: */
30: void setAnswer(boolean newAnswer);
31: }