示例#1
0
        IEnumerable <Renderable> SpritesToRender()
        {
            var bounds   = Game.viewport.WorldBounds(world);
            var comparer = new SpriteComparer();

            var actors = world.FindUnits(
                new int2(Game.CellSize * bounds.Left, Game.CellSize * bounds.Top),
                new int2(Game.CellSize * bounds.Right, Game.CellSize * bounds.Bottom));

            var renderables = actors.SelectMany(a => a.Render())
                              .OrderBy(r => r, comparer);

            var effects = world.Effects.SelectMany(e => e.Render());

            return(renderables.Concat(effects));
        }
示例#2
0
        IEnumerable <Renderable> SpritesToRender()
        {
            var bounds   = Game.viewport.WorldBounds(world);
            var comparer = new SpriteComparer();

            var actors = world.FindUnits(
                bounds.TopLeftAsCPos().ToPPos(),
                bounds.BottomRightAsCPos().ToPPos()
                );

            var renderables = actors.SelectMany(a => a.Render())
                              .OrderBy(r => r, comparer);

            var effects = world.Effects.SelectMany(e => e.Render());

            return(renderables.Concat(effects));
        }