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(); } }
public void DrawContent(SpriteBatch spriteBatch, Camera camera) { // Draw Player DisplaySystem.DisplayEntity(spriteBatch, camera, this._player.DisplayInfo, this._player.PositionInfo, _placeholderSpritesheet); // Draw Creatures this._creatures.ForEach(c => DisplaySystem.DisplayEntity(spriteBatch, camera, c.DisplayInfo, c.PositionInfo, _placeholderSpritesheet)); // Draw Labels DisplaySystem.DisplayLabel(spriteBatch, camera, this._player.DisplayInfo, this._player.LabelInfo, this._player.PositionInfo, _placeholderLabel, this._player.PositionInfo, this._player.DisplayInfo); this._creatures.ForEach(c => DisplaySystem.DisplayLabel(spriteBatch, camera, c.DisplayInfo, c.LabelInfo, c.PositionInfo, this._placeholderLabel, this._player.PositionInfo, this._player.DisplayInfo)); #region debug #endregion }