public static Bitmap Get(int key) { var name = ChampNames.GetOrDefault(key); if (name == null) { StaticLogger.Debug("Unknown champid " + key); return(_unknown); } var bmp = FindCached(key); if (bmp != null) { return(bmp); } bmp = SafeBitmap(string.Format("{0}{1}_Square_0.png", ChampPath, name)); if (bmp == null) { StaticLogger.Debug("Unknown champ icon " + name); return(_unknown); } AddCached(key, bmp); return(bmp); }
static ChampNames() { _instance = JsonConvert.DeserializeObject <ChampNames>(File.ReadAllText(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Content/Data/ChampData.json"))); }
static ChampNames() { _instance = JsonConvert.DeserializeObject <ChampNames>(Resources.ChampData); }