Dwarrowdelf.Client.TileSetLoader.DecideTileGfx C# (CSharp) Method

DecideTileGfx() private method

private DecideTileGfx ( Symbol symbol, int size ) : GfxBase
symbol Symbol
size int
return 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();
        }