private static void WriteResult(ILookup <int, Monster> points) { var file = Path.Combine(Folder, "result.json"); var data = new { t = JavascriptUtil.GetTimeValue(DateTime.Now), m = points.OrderBy(t => t.Key).ToDictionary(t => t.Key, t => t.Count()) }; var json = JsonConvert.SerializeObject(data); File.WriteAllText(file, json); }
private static void WriteMonster(IGrouping <int, Monster> points) { var file = Path.Combine(Folder, points.Key + ".json"); var data = points.Select(t => new { a = t.Latitude, o = t.Longitude, t = JavascriptUtil.GetTimeValue(t.Time) / 1000 }).ToArray(); var json = JsonConvert.SerializeObject(data); File.WriteAllText(file, json); }