예제 #1
0
        public void DrawContent(SpriteBatch spriteBatch, Camera camera)
        {
            Guid playerId = this._components.Entities.Where(c => c.HasComponents(ComponentFlags.IS_PLAYER)).FirstOrDefault().Id;

            // Draw Dungeon
            DisplaySystem.DrawDungeon(camera, spriteBatch, this._dungeonGrid, this._spriteSheets[Constants.Sprites.TileSheetKey], this._gridCols, this._gridRows);

            // Draw Sprites
            this._components.Entities.ForEach((c) =>
            {
                if (c.HasDrawableSprite())
                {
                    drawSequence[this._components.Displays[c.Id].Layer].Add(new Action(() =>
                    {
                        DisplaySystem.DisplayEntity(spriteBatch, camera, this._components.Displays[c.Id], this._components.Positions[c.Id], this._spriteSheets[this._components.Displays[c.Id].SpriteSheetKey]);
                    }));
                }
                if (c.HasDrawableLabel())
                {
                    DisplaySystem.DisplayLabel(spriteBatch, camera, this._components.Displays[c.Id], this._components.Labels[c.Id], this._components.Positions[c.Id], _labelFont, this._components.Positions[playerId], this._components.Displays[playerId]);
                }
            });
            foreach (DisplayLayer key in drawSequence.Keys)
            {
                drawSequence[key].ForEach(x => x.Invoke());
                drawSequence[key].Clear();
            }
        }