Class Area
Represents a collection of adjacent points that form a single area.
Inheritance
object
Area
Implements
DelaunatorSharp.IPoint
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: InsaneScatterbrain.MapGraph
Syntax
public class Area : IPoint
Constructors
Area()
Declaration
public Area()
Area(IEnumerable<Vector2Int>)
Declaration
[Obsolete("Please use the pool manager to get a Area instance. This constructor will probably be removed in version 2.0. Alternatively, use the parameterless constructor and call the Set method.")]
public Area(IEnumerable<Vector2Int> points)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><UnityEngine.Vector2Int> | points |
Properties
BorderPoints
Gets all the points on the outer edge of the area.
Declaration
public IReadOnlyCollection<Vector2Int> BorderPoints { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<T><UnityEngine.Vector2Int> |
BoundingBox
Declaration
public RectInt BoundingBox { get; }
Property Value
Type | Description |
---|---|
UnityEngine.RectInt |
Centroid
Gets the centroid of the area.
Declaration
public Vector2Int Centroid { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Vector2Int |
Points
Gets all the points the area consists of.
Declaration
public ReadOnlyCollection<Vector2Int> Points { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T><UnityEngine.Vector2Int> |
X
Declaration
public double X { get; set; }
Property Value
Type | Description |
---|---|
double |
Y
Declaration
public double Y { get; set; }
Property Value
Type | Description |
---|---|
double |
Methods
Add(Vector2Int)
Declaration
public void Add(Vector2Int point)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector2Int | point |
Contains(Vector2Int)
Declaration
public bool Contains(Vector2Int point)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector2Int | point |
Returns
Type | Description |
---|---|
bool |
CreateFromRect(RectInt)
Create an area from a rectangle.
Declaration
public static Area CreateFromRect(RectInt rect)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.RectInt | rect | The rectangle. |
Returns
Type | Description |
---|---|
Area | The area. |
Merge(Area, Area)
Merges this area and another one together, creating a new area object.
Declaration
public void Merge(Area other, Area result)
Parameters
Type | Name | Description |
---|---|---|
Area | other | The other area. |
Area | result | The merged result. |
Merge(Area)
Merges this area and another one together, creating a new area object.
Declaration
[Obsolete("This method will be removed in version 2.0. Please use the one with the result parameter instead.")]
public Area Merge(Area other)
Parameters
Type | Name | Description |
---|---|---|
Area | other | The other area. |
Returns
Type | Description |
---|---|
Area | The merged area. |
Overlaps(Area)
Checks whether this area overlaps with another.
Declaration
public bool Overlaps(Area other)
Parameters
Type | Name | Description |
---|---|---|
Area | other | The other area. |
Returns
Type | Description |
---|---|
bool | True if they overlap, false otherwise. |
Reset()
Declaration
public void Reset()
Set(IEnumerable<Vector2Int>)
Creates a new area of the given points.
Declaration
public void Set(IEnumerable<Vector2Int> initialPoints)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><UnityEngine.Vector2Int> | initialPoints | The points. |
Implements
DelaunatorSharp.IPoint