-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJson.cs
34 lines (29 loc) · 1.01 KB
/
Json.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
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace SteamStatus.Net
{
public class Json
{
[JsonProperty("time")] public int Time { get; set; }
[JsonProperty("online")] public double Online { get; set; }
/// <summary>
/// @param - id (csgo, store, etc...)
/// @param - bool (die?)
/// @param - status (normal, ok, etc...)
/// </summary>
[JsonProperty("services")]
public List<List<object>> Services { get; set; }
//public Dictionary<string, Online> Services { get; set; }
public DateTime CurrentTime => DateTimeOffset.FromUnixTimeSeconds(this.Time).DateTime;
public Dictionary<string, string> ServicesDictionary()
{
var dict = new Dictionary<string, string>();
foreach (var service in Services)
{
dict.Add((string) service[0], (string) service[2]);
}
return dict;
}
}
}