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

DecideGfx() private method

private DecideGfx ( Symbol symbol ) : GfxBase
symbol Symbol
return GfxBase
        GfxBase DecideGfx(Symbol symbol)
        {
            var gfxs = symbol.Graphics;

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

            GfxBase gfx;

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

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

            throw new Exception();
        }