29 lines
845 B
C#
29 lines
845 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Assets.Common
|
|
{
|
|
[Serializable]
|
|
public class MapSite
|
|
{
|
|
public readonly Metadata Metadata = new Metadata();
|
|
|
|
public MapSite(Point center, IEnumerable<int> boundary)
|
|
{
|
|
Center = center;
|
|
Boundary = boundary;
|
|
}
|
|
|
|
public int Index { get; internal set; }
|
|
public Point Center { get; set; }
|
|
public bool IsOuter { get; set; } = false;
|
|
public ISet<string> Tags { get; set; } = new HashSet<string> { "Empty" };
|
|
public IEnumerable<int> Boundary { get; set; }
|
|
public IEnumerable<(int, int)> Edges => Boundary.RotateRight().Zip(Boundary, (a, b) => (a, b));
|
|
|
|
[field: NonSerialized]
|
|
public Map Map { get; internal set; }
|
|
}
|
|
} |