NHSE/NHSE.Core/Structures/Map/Layers/ILayerBuilding.cs
Kurt b88c518d5c
Update FieldItemEditor for 3.0.0 (#716)
Updates the Field Item Editor to render layers based on the entire map, and the per-patch positioning of each layer.
Import/export will gracefully handle upgrade/downgrade, and viewport import/export will gracefully update tiles rather than a per-acre basis.

Performance has also been slightly improved; no allocation is done anymore when updating the image.
2026-01-25 16:55:38 -06:00

33 lines
1.1 KiB
C#

using System.Collections.Generic;
namespace NHSE.Core;
/// <summary>
/// Logic for interacting with a map's building layer.
/// </summary>
public interface ILayerBuilding
{
/// <summary>
/// Instantiated list of all buildings on the map.
/// </summary>
IReadOnlyList<Building> Buildings { get; init; }
/// <summary>
/// Converts relative building coordinates to absolute coordinates in the map grid.
/// </summary>
/// <param name="relX">Relative building X coordinate</param>
/// <param name="relY">Relative building Y coordinate</param>
/// <returns>Map absolute X/Y coordinates</returns>
(int X, int Y) GetCoordinatesAbsolute(ushort relX, ushort relY);
/// <summary>
/// Converts absolute map grid coordinates to relative building coordinates.
/// </summary>
/// <param name="absX">Map absolute X coordinate</param>
/// <param name="absY">Map absolute Y coordinate</param>
/// <returns>Relative building X/Y coordinates</returns>
(int X, int Y) GetCoordinatesRelative(int absX, int absY);
Building this[int i] { get; }
int Count { get; }
}