Skip to content

Package: GDPlayer

GDPlayer

Coverage

1: /*
2: * Copyright © 2021-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of ipspiel24-GD.
5: *
6: * ipspiel24-GD 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: * ipspiel24-GD 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 ipspiel24-GD. If not, see
14: * <http://www.gnu.org/licenses/>.
15: */
16: package de.fhdw.gaming.GefangenenDilemma.domain;
17:
18: import java.util.Map;
19: import java.util.Optional;
20: import java.util.Random;
21:
22: import de.fhdw.gaming.GefangenenDilemma.domain.impl.GDGameBuilderFactoryImpl;
23: import de.fhdw.gaming.core.domain.Player;
24:
25: /**
26: * Represents a Gefangenen-Dilemma player.
27: */
28: public interface GDPlayer extends Player<GDPlayer> {
29:
30: /**
31: * Returns the possible outcomes of this player. The key for the first-level map is the answer of the first player,
32: * the key for the second-level map is the answer of the second player.
33: */
34: @SuppressWarnings("exports")
35: Map<GDGameBuilderFactoryImpl.MOVES,
36: Map<GDGameBuilderFactoryImpl.MOVES, Double>> getPossibleOutcomes();
37:
38: /**
39: * Returns the answer of this player.
40: */
41: @SuppressWarnings("exports")
42: Optional<GDGameBuilderFactoryImpl.MOVES> getAnswer();
43:
44: /**
45: * Sets the answer of this player.
46: *
47: * @param newAnswer The answer to set.
48: * @throws IllegalStateException if an answer has already been set.
49: */
50: @SuppressWarnings("exports")
51: void setAnswer(GDGameBuilderFactoryImpl.MOVES newAnswer);
52:
53: @Override
54: GDPlayer deepCopy();
55:
56: /**
57: * getter for random.
58: */
59: Random getRandom();
60: }