-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvent.java
62 lines (49 loc) · 1.14 KB
/
Event.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import java.util.Comparator;
public class Event {
private int playerId;
private double duration;
private double startTime;
private int type;//0=training 1=massage 2=physiotherapy 3=quitmassage 4=quitphysiotherapy
private int workerId;
public Event(int playerId, double startTime, double duration, int type) {
this.playerId = playerId;
this.startTime = startTime;
this.duration = duration;
this.type = type;
}
Comparator<Event> chronologicalOrderer = new Comparator<Event>() {
public int compare(Event e1, Event e2) {
if (e1.startTime<e2.startTime)
return -1;
else
return 1;
}
};
public int getType() {
return this.type;
}
public int getPlayerId() {
return this.playerId;
}
public double getStartTime() {
return this.startTime;
}
public double getDuration() {
return this.duration;
}
public int getWorkerId() {
return this.workerId;
}
public void reduceTimeBy(double interval) {
this.startTime -= interval;
}
public void setType(int s) {
this.type = s;
}
public void setDuration(double time) {
this.duration = time;
}
public void setWorkerId(int id) {
this.workerId = id;
}
}