-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameState.java
More file actions
31 lines (24 loc) · 966 Bytes
/
Copy pathGameState.java
File metadata and controls
31 lines (24 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.*;
public class GameState {
Map<String, Integer> suspectScore = new HashMap<>();
Map<String, Integer> weaponScore = new HashMap<>();
Map<String, Integer> roomScore = new HashMap<>();
public GameState() {
// Initialize with all possible values so pickBest works immediately
List<String> suspects = Arrays.asList(
"MissScarlett","ColMustard","MrsWhite",
"MrGreen","MrsPeacock","ProfPlum"
);
List<String> weapons = Arrays.asList(
"Knife","Candlestick","Revolver",
"Pipe","Rope","Wrench"
);
List<String> rooms = Arrays.asList(
"Library","Conservatory","Kitchen","DiningRoom",
"Hall","Ballroom","BilliardRoom","Lounge","Study"
);
for (String s : suspects) suspectScore.put(s, 0);
for (String w : weapons) weaponScore.put(w, 0);
for (String r : rooms) roomScore.put(r, 0);
}
}