-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhandlers.pde
50 lines (44 loc) · 1.18 KB
/
handlers.pde
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
///
void ColorStripHandler(){
String[] colors = new String[6];
colors[0] = "fff91f1f";
colors[1] = "fff9a21f";
colors[2] = "fff9a21f";
colors[3] = "fff9f91f";
colors[4] = "ff1ace1a";
colors[5] = "ff1aa1ce";
booths[currentIndex].setColorStrip(colors);
}
class PersonHandler implements EventHandler {
public void callback(Event event){
int roomIndex = eventNameToRoomNumber(event.name);
float[] coords = event.floatArray;
booths[roomIndex].setPerson(coords);
}
}
///
void AlertHandler(){
booths[currentIndex].setAlert(true);
}
///
void BeepHandler(){
println("beep!");
booths[currentIndex].setBeep(random(1));
}
class ThoughtHandler implements EventHandler {
public void callback(Event event){
String idea = new String(event.stringValue);
int roomIndex = eventNameToRoomNumber(event.name);
booths[roomIndex].setThought(idea);
}
}
class BoothHandler implements EventHandler {
public void callback(Event event){
int roomIndex = eventNameToRoomNumber(event.name);
currentIndex = (currentIndex == totalBoothNumber - 1 ) ? 0 : currentIndex+1;
if (currentIndex == (outputBoothNb-1)){
currentIndex++;
}
transition = true;
}
}