Show / Hide Table of Contents

Class RectangleEdgePositionsList

An arbitrary list of any number of positions on the perimeter of a rectangle. Commonly used to represent a list of doors or edges of rooms by some map generation steps.

Inheritance
object
RectangleEdgePositionsList
Implements
IEnumerable<Point>
IEnumerable
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: GoRogue.MapGeneration
Assembly: GoRogue.dll
Syntax
public class RectangleEdgePositionsList : IEnumerable<Point>, IEnumerable

Constructors

View Source

RectangleEdgePositionsList(Rectangle)

Creates a empty list of perimeter for a given rectangle.

Declaration
public RectangleEdgePositionsList(Rectangle rectangle)
Parameters
Type Name Description
Rectangle rectangle

The rectangle the structure stores perimeter positions for.

Fields

View Source

Rectangle

The rectangle whose edge positions are being stored.

Declaration
public readonly Rectangle Rectangle
Field Value
Type Description
Rectangle

Properties

View Source

BottomPositions

Positions of doors on the bottom wall of the rectangle.

Declaration
public IReadOnlyList<Point> BottomPositions { get; }
Property Value
Type Description
IReadOnlyList<Point>
View Source

this[Direction]

Retrieves a read-only list of stored positions on the given side. Direction specified must be a cardinal.

Declaration
public IReadOnlyList<Point> this[Direction side] { get; }
Parameters
Type Name Description
Direction side

Side to get stored positions for.

Property Value
Type Description
IReadOnlyList<Point>

A read-only list of stored positions on the given side.

View Source

LeftPositions

Positions of doors on the bottom wall of the rectangle.

Declaration
public IReadOnlyList<Point> LeftPositions { get; }
Property Value
Type Description
IReadOnlyList<Point>
View Source

Positions

Positions being stored, with no duplicate locations.

Declaration
public IEnumerable<Point> Positions { get; }
Property Value
Type Description
IEnumerable<Point>
View Source

RightPositions

Positions of doors on the right wall of the rectangle.

Declaration
public IReadOnlyList<Point> RightPositions { get; }
Property Value
Type Description
IReadOnlyList<Point>
View Source

TopPositions

Positions on the top edge of the rectangle.

Declaration
public IReadOnlyList<Point> TopPositions { get; }
Property Value
Type Description
IReadOnlyList<Point>

Methods

View Source

Add(Point)

Adds the given position to the appropriate lists of positions.

Declaration
public void Add(Point perimeterPosition)
Parameters
Type Name Description
Point perimeterPosition

Position to add.

View Source

AddRange(params Point[])

Adds the given positions to the appropriate lists of positions.

Declaration
public void AddRange(params Point[] perimeterPositions)
Parameters
Type Name Description
Point[] perimeterPositions

Positions to add.

View Source

AddRange(IEnumerable<Point>)

Adds the given positions to the appropriate lists of positions.

Declaration
public void AddRange(IEnumerable<Point> perimeterPositions)
Parameters
Type Name Description
IEnumerable<Point> perimeterPositions

Positions to add.

View Source

Contains(Point)

Returns whether or not the structure contains the given position.

Declaration
public bool Contains(Point position)
Parameters
Type Name Description
Point position
Returns
Type Description
bool

Whether or not the structure contains the position specified.

View Source

GetEnumerator()

Gets an enumerator of all positions in the data structure.

Declaration
public IEnumerator<Point> GetEnumerator()
Returns
Type Description
IEnumerator<Point>
View Source

Remove(Point)

Removes the given position from the data structure.

Declaration
public void Remove(Point perimeterPosition)
Parameters
Type Name Description
Point perimeterPosition

Position to remove.

View Source

RemoveRange(params Point[])

Removes the given positions from the data structure.

Declaration
public void RemoveRange(params Point[] perimeterPositions)
Parameters
Type Name Description
Point[] perimeterPositions

Positions to remove.

View Source

RemoveRange(IEnumerable<Point>)

Removes the given positions from the data structure.

Declaration
public void RemoveRange(IEnumerable<Point> perimeterPositions)
Parameters
Type Name Description
IEnumerable<Point> perimeterPositions

Positions to remove.

Implements

IEnumerable<T>
IEnumerable

Extension Methods

Utility.Yield<T>(T)
LineHelpers.BottomAt(IEnumerable<Point>, int)
LineHelpers.LeftAt(IEnumerable<Point>, int)
LineHelpers.RightAt(IEnumerable<Point>, int)
LineHelpers.TopAt(IEnumerable<Point>, int)
  • View Source
In this article
Back to top Generated by DocFX