コード例 #1
0
ファイル: IconManager.cs プロジェクト: chienhao10/EloBuddy-13
 private static Bitmap GetBitmap(Cache.CacheType cacheType, string name, IconGenerator.IconType type,
                                 int size, Color borderColor, float borderWidth, out Cache cache)
 {
     SetIconGeneratorSettings(type, size, borderColor, borderWidth);
     cache = CreateCache(cacheType, name);
     if (BitmapCache.ContainsKey(cache))
     {
         return(BitmapCache[cache]);                                //Bitmap has been created already, return it.
     }
     //Bitmap has been created yet, so lets create it and cache it.
     return(BitmapCache[cache] = IconGenerator.GetIcon(name)); // All done, returning sprite.
 }
コード例 #2
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
 public static Sprite GetSpellSprite(string spellName, IconGenerator.IconType type, int size, Color borderColor, float borderWidth)
 {
     Cache cache;
     return GetSprite(Cache.CacheType.Spell, spellName, type, size, borderColor, borderWidth, out cache);
 }
コード例 #3
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
 public static Bitmap GetSpellBitmap(SpellDataInst spell, IconGenerator.IconType type, int size, Color borderColor, float borderWidth)
 {
     Cache cache;
     return GetBitmap(Cache.CacheType.Spell, spell.Name, type, size, borderColor, borderWidth, out cache);
 }
コード例 #4
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
 public static Sprite GetChampionSprite(AIHeroClient hero, IconGenerator.IconType type, int size, Color borderColor, float borderWidth)
 {
     Cache cache;
     return GetSprite(Cache.CacheType.Champion, hero.ChampionName, type, size, borderColor, borderWidth, out cache);
 }
コード例 #5
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
 public static Bitmap GetChampionBitmap(string hero, IconGenerator.IconType type, int size, Color borderColor, float borderWidth)
 {
     Cache cache;
     return GetBitmap(Cache.CacheType.Champion, hero, type, size, borderColor, borderWidth, out cache);
 }
コード例 #6
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
 public Cache(CacheType cacheType, string name, IconGenerator.IconType type, int size, Color borderColor, float borderWidth)
 {
     Type = cacheType;
     Name = name;
     IconType = type;
     Size = size;
     BorderColor = borderColor;
     BorderWidth = borderWidth;
 }
コード例 #7
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
 static IconManager()
 {
     IconGenerator = new IconGenerator(IconGenerator.IconType.Circle, 32, 32, IconGenerator.DefaultGoldColor, 2);
     BitmapCache = new Dictionary<Cache, Bitmap>();
     SpriteCache = new Dictionary<Cache, Sprite>();
 }
コード例 #8
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
 private static void SetIconGeneratorSettings(IconGenerator.IconType type, int size, Color borderColor, float borderWidth)
 {
     IconGenerator.Type = type;
     IconGenerator.Width = size;
     IconGenerator.Height = size;
     IconGenerator.BorderColor = borderColor;
     IconGenerator.BorderWidth = borderWidth;
 }
コード例 #9
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
 private static Sprite GetSprite(Cache.CacheType cacheType, string name, IconGenerator.IconType type,
     int size, Color borderColor, float borderWidth, out Cache cache)
 {
     var bitmap = GetBitmap(cacheType, name, type, size, borderColor, borderWidth,  out cache);
     if (SpriteCache.ContainsKey(cache)) return SpriteCache[cache];
     return SpriteCache[cache] = new Sprite(TextureLoader.BitmapToTexture(bitmap)); // All done, returning sprite.
 }
コード例 #10
0
ファイル: IconManager.cs プロジェクト: bruno105/OKTRAIO
        private static Bitmap GetBitmap(Cache.CacheType cacheType, string name, IconGenerator.IconType type, 
            int size, Color borderColor, float borderWidth, out Cache cache)
        {
            SetIconGeneratorSettings(type, size, borderColor, borderWidth);
            cache = CreateCache(cacheType, name);
            if (BitmapCache.ContainsKey(cache)) return BitmapCache[cache]; //Bitmap has been created already, return it.

            //Bitmap has been created yet, so lets create it and cache it.
            return BitmapCache[cache] = IconGenerator.GetIcon(name); // All done, returning sprite.
        }
コード例 #11
0
ファイル: IconManager.cs プロジェクト: chienhao10/EloBuddy-13
 static IconManager()
 {
     IconGenerator = new IconGenerator(IconGenerator.IconType.Circle, 32, 32, IconGenerator.DefaultGoldColor, 2);
     BitmapCache   = new Dictionary <Cache, Bitmap>();
     SpriteCache   = new Dictionary <Cache, Sprite>();
 }