-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimulator.java
29 lines (26 loc) · 988 Bytes
/
Simulator.java
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
import java.util.*;
public class Simulator {
private static Set<Thing> thingsInSimulation;
static {
thingsInSimulation = new HashSet<>();
Room room1 = new Room("Kitchen");
Room room2 = new Room("Living Room");
Person jane = new Person("Jane", "F", room1);
Person john = new Person("John", "M", room2);
Microwave sonyMicrowave = new Microwave("Sony Microwave", room1, true);
Microwave samsungMicrowave = new Microwave("Samsung Microwave", room1, false);
SecuritySystem comcastSec = new SecuritySystem("Comcast Security System", room2, true);
AC panasonicAC = new AC("Panasonic AC", room2, true);
thingsInSimulation.add(jane);
thingsInSimulation.add(john);
thingsInSimulation.add(room1);
thingsInSimulation.add(room2);
thingsInSimulation.add(sonyMicrowave);
thingsInSimulation.add(samsungMicrowave);
thingsInSimulation.add(panasonicAC);
thingsInSimulation.add(comcastSec);
}
public static Set<Thing> getThings() {
return thingsInSimulation;
}
}