-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorganizeJSON.cs
38 lines (34 loc) · 999 Bytes
/
organizeJSON.cs
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
public struct Student
{
public string id;
public int[] pos = new int[4];
public double emotions = new double[8];
public Person(string id, int pos, double emotions)
{
ID = id;
position = pos;
Emo = emotions;
}
}
public class Application
{
static void Main(JSONRetVal)
{
// Create struct instance and initialize by using "new".
// Memory is allocated on thread stack.
Student s1 = new Student("", int [4], double [8]);
s1.ID = 12345;
s1.position[0] = JSONRetVal[0]["left"]
s1.position[1] = JSONRetVal[0]["top"]
s1.position[2] = JSONRetVal[0]["width"]
s1.position[3] = JSONRetVal[0]["height"]
s1.EMo[0] = JSONRetVal[1]["anger"]
s1.EMo[0] = JSONRetVal[1]["contempt"]
s1.EMo[0] = JSONRetVal[1]["disgust"]
s1.EMo[0] = JSONRetVal[1]["fear"]
s1.EMo[0] = JSONRetVal[1]["happiness"]
s1.EMo[0] = JSONRetVal[1]["neutral"]
s1.EMo[0] = JSONRetVal[1]["sadness"]
s1.EMo[0] = JSONRetVal[1]["surprise"]
}
}