-
Notifications
You must be signed in to change notification settings - Fork 3
/
MissileService.cs
56 lines (50 loc) · 1.23 KB
/
MissileService.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
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace LoLSharp.Modules
{
public class MissileDataVo
{
public string Name;
public string ChampionName;
public string ChampionNameLowerCase;
public float Delay;
public int CastRange;
public float CastRadius;
public float Width;
public float Height;
public float Speed;
public float Flags;
public MissileDataVo(string name)
{
Name = name;
ChampionName = "Default";
}
public MissileDataVo()
{
}
}
public class MissileService
{
static string Missiles = File.ReadAllText(Directory.GetCurrentDirectory() + @"\Missiles.json");
public static MissileDataVo[] List;
public static Dictionary<string, MissileDataVo> Map = new Dictionary<string, MissileDataVo>();
public static void ParseMissileDBData()
{
try
{
List = JsonConvert.DeserializeObject<MissileDataVo[]>(Missiles);
foreach (var vo in List)
{
Map[vo.Name] = vo;
}
}
catch (Exception Ex)
{
LogService.Log(Ex.ToString(), Enums.LogLevel.Error);
throw new Exception("MissileServiceParseExecption");
}
}
}
}