-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.pde
More file actions
55 lines (47 loc) · 2.12 KB
/
Copy pathsave.pde
File metadata and controls
55 lines (47 loc) · 2.12 KB
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
public void saveclick(GButton source, GEvent event) { //_CODE_:notes:768397:
println("saving...");
for(int i = 0; i < positionarray.size(); i++){
JSONObject json;
String position = positionarray.get(i).getPosition();
json = new JSONObject();
json.setInt("id", positionarray.get(i).getId());
json.setString("position", positionarray.get(i).getPosition());
json.setInt("speaktime", positionarray.get(i).getSpeaktime());
json.setInt("speeches", positionarray.get(i).getSpeeches());
json.setString("chairnotes", positionarray.get(i).getChairnotes());
json.setBoolean("attendance", positionarray.get(i).getAttendance());
String jpeg = (positionarray.get(i).getImageurl());
json.setString("imageurl", jpeg);
String savefile = ("data/positions/" + position + ".json");
saveJSONObject(json, savefile);
}
json = new JSONObject();
json.setInt("totaltimespoken", totaltimespoken);
json.setInt("totalspeeches", totalspeeches);
String savefile = ("data/stats.json");
saveJSONObject(json, savefile);
println("saved");
} //_CODE_:notes:768397:
public void save(){
println("saving...");
for(int i = 0; i < positionarray.size(); i++){
String position = positionarray.get(i).getPosition();
json = new JSONObject();
json.setInt("id", positionarray.get(i).getId());
json.setString("position", positionarray.get(i).getPosition());
json.setInt("speaktime", positionarray.get(i).getSpeaktime());
json.setInt("speeches", positionarray.get(i).getSpeeches());
json.setString("chairnotes", positionarray.get(i).getChairnotes());
json.setBoolean("attendance", positionarray.get(i).getAttendance());
String jpeg = (positionarray.get(i).getImageurl());
json.setString("imageurl", jpeg);
String savefile = ("data/positions/" + position + ".json");
saveJSONObject(json, savefile);
}
json = new JSONObject();
json.setInt("totaltimespoken", totaltimespoken);
json.setInt("totalspeeches", totalspeeches);
String savefile = ("data/stats.json");
saveJSONObject(json, savefile);
println("saved");
}