{
"count": 10, //количество элементов
"Event":
[//GameEvent Array
{
"ID": 0,
"Text": "Hello!"
{//EventInfo
"TimeOut": 0
}
}
{
"ID": 1,
"Text": "I keep data."
{
"TimeOut": 42
}
}
//...
]
}
DataContract]
public sealed class GameEvent
{
[DataMember]
public EventInfo EventInfo { get; }
[DataMember]
public string Text { get; }
internal GameEvent(string text, EventInfo ei)
{
Text = text;
EventInfo = ei;
}
internal GameEvent(string text)
: this(text, default(EventInfo))
{ }
}
[DataContract()]
public struct EventInfo
{
[DataMember]
TimeSpan TimeOut;
internal EventInfo(TimeSpan timeOut)
{
TimeOut = timeOut;
}
}