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