Dwarrowdelf.Client.TileSetLoader.DecideTileGfx C# (CSharp) Метод

DecideTileGfx() приватный Метод

private DecideTileGfx ( Symbol symbol, int size ) : GfxBase
symbol Symbol
size int
Результат GfxBase
        GfxBase DecideTileGfx(Symbol symbol, int size)
        {
            var gfxs = symbol.Graphics;

            if (gfxs.Count == 1)
                return gfxs[0];

            GfxBase gfx;

            gfx = gfxs.OfType<BitmapGfx>().FirstOrDefault();
            if (gfx != null)
            {
                if (size <= m_bitmapSizes.Max())
                    return gfx;
            }

            gfx = gfxs.OfType<VectorGfxBase>().FirstOrDefault();
            if (gfx != null)
                return gfx;

            throw new Exception();
        }