using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace Assets.Common { [Serializable] public class MapSite : IHasMetadata { public Metadata Metadata { get; } = new Metadata(); public MapSite(Point center, IEnumerable boundary) { Center = center; Boundary = boundary; } public int Index { get; internal set; } public Point Center { get; set; } public ISet Tags { get; set; } = new HashSet { CommonTags.Empty }; public IEnumerable Boundary { get; set; } public IEnumerable<(int, int)> Edges => Boundary.RotateRight().Zip(Boundary, (a, b) => (a, b)); [field: NonSerialized] public Map Map { get; internal set; } } }