-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmotionalResponseArray.cs
49 lines (44 loc) · 1.1 KB
/
EmotionalResponseArray.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
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace emotion_viewer.cs
{
class EmotionalResponseArray
{
List<EmotionalResponse> responses;
public EmotionalResponseArray()
{
responses = new List<EmotionalResponse>();
}
public void addResponse(EmotionalResponse response)
{
response.endEmotion();
responses.Add(response);
}
internal string ToJson()
{
string json;
if (responses.Count > 0)
{
json = "[";
for (int i = 0; i < responses.Count - 1; i++)
{
json += responses[i].getJson() + ",";
}
json += responses[responses.Count - 1].getJson() + "]";
}
else
{
json = "{}";
}
return json;
}
public int Count()
{
return responses.Count;
}
}
}