/// <summary> /// /// </summary> /// <param name="batch"></param> /// <param name="field"></param> /// <param name="position"></param> /// <param name="direction"></param> public override void Draw(SpriteBatch batch, ViewField field, ViewFieldPosition position, CardinalPoint direction) { // Foreach wall side foreach (TileDrawing td in DisplayCoordinates.GetWalls(position)) { // Not the good side if (Compass.GetDirectionFromView(direction, td.Side) != Side) { continue; } DecorationSet decoset = field.Maze.Decoration; if (decoset == null) { return; } Decoration deco = decoset.GetDecoration(IsActivated ? ActivatedDecoration : DeactivatedDecoration); if (deco == null) { return; } deco.DrawDecoration(batch, decoset, position, Compass.IsSideFacing(direction, Side)); } }
/// <summary> /// Draws all alcoves according to the view point /// </summary> /// <param name="batch">Spritebatch handle</param> /// <param name="field">Field of view handle</param> /// <param name="position">Position in the field of view</param> /// <param name="direction">Looking direction</param> public override void Draw(SpriteBatch batch, ViewField field, ViewFieldPosition position, CardinalPoint direction) { if (field.Maze.Decoration == null) { return; } // For each wall side, draws the decoration foreach (CardinalPoint side in DisplayCoordinates.DrawingWallSides[(int)position]) { Alcove alcove = GetAlcove(Compass.GetDirectionFromView(direction, side)); // Get the decoration Decoration deco = field.Maze.Decoration.GetDecoration(alcove.Decoration); if (deco == null) { continue; } // Draw the decoration deco.DrawDecoration(batch, field.Maze.Decoration, position, side == CardinalPoint.South); // Hide items if (alcove.HideItems || side != CardinalPoint.South) { continue; } // Offset the item locations according to the distance Vector2 vect = DisplayCoordinates.GetMonsterScaleFactor(position); Point loc = deco.PrepareLocation(position); loc.Offset((int)(deco.ItemLocation.X * vect.X), (int)(deco.ItemLocation.Y * vect.Y)); // Draw items in the alcove in front of the team foreach (Item item in Square.GetItemsFromSide(direction, side)) { batch.DrawTile(Square.Maze.Dungeon.ItemTileSet, item.GroundTileID, loc, DisplayCoordinates.GetDistantColor(position), 0.0f, DisplayCoordinates.GetItemScaleFactor(position), SpriteEffects.None, 0.0f); } } }