private List <MonsterRole> GetAll() { if (!File.Exists(mFilePath)) { return(new List <MonsterRole>()); } if (!mCache.CachedAllIsValid()) { string json = File.ReadAllText(mFilePath); mCache.CacheAll(JsonConvert.DeserializeObject <List <MonsterRole> >(json)); } return(mCache.CachedAll); }
private List <Summoner> GetAll() { if (!File.Exists(mFilePath)) { return(new List <Summoner>()); } if (!mCache.CachedAllIsValid()) { string json = File.ReadAllText(mFilePath); JObject profile = JObject.Parse(json); Summoner summoner = JsonConvert.DeserializeObject <Summoner>(JsonConvert.SerializeObject(profile["wizard_info"])); mCache.CacheAll(new List <Summoner> { summoner }); } return(mCache.CachedAll); }
public List <Rune> GetAll() { if (!File.Exists(mFilePath)) { return(new List <Rune>()); } if (!mCache.CachedAllIsValid()) { string json = File.ReadAllText(mFilePath); JObject profile = JObject.Parse(json); List <Rune> runes = ParseRunesJson(profile["runes"]); foreach (JObject monster in profile["unit_list"]) { runes.AddRange(ParseRunesJson(monster["runes"])); } mCache.CacheAll(runes); } return(mCache.CachedAll); }