Table of Contents

Class ExpandableRectangleArray<T>

Namespace
OmegaEngine.Foundation.Geometry
Assembly
OmegaEngine.Foundation.dll

Builds a rectangle array that can grow in any direction.

public class ExpandableRectangleArray<T> where T : struct

Type Parameters

T

The type of elements to store in the array.

Inheritance
ExpandableRectangleArray<T>
Inherited Members
Extension Methods

Properties

TotalArea

The total area the rectangle currently encompasses.

public Rectangle TotalArea { get; }

Property Value

Rectangle

Methods

AddFirst(Point, T[,])

Insert a new subset array before any existing entries growing the rectangle as necessary.

public void AddFirst(Point start, T[,] array)

Parameters

start Point

The top-left coordinates of the area to insert the array into.

array T[,]

The array to insert. Do not modify this array after calling this method!

AddLast(Point, T[,])

Insert a new subset array after any existing entries growing the rectangle as necessary.

public void AddLast(Point start, T[,] array)

Parameters

start Point

The top-left coordinates of the area to insert the array into.

array T[,]

The array to insert. Do not modify this array after calling this method!

GetArray()

Returns the smallest possible array that encompasses all inserted subsets. Blanks between subsets are filled with the default value for T.

public T[,] GetArray()

Returns

T[,]

An array containing the copyed data. Size will be determined by TotalArea.

GetArray(Grid<T>)

Returns the smallest possible array that encompasses all inserted subsets and can be backed by a base array.

[Pure]
public T[,] GetArray(Grid<T> baseValues)

Parameters

baseValues Grid<T>

An array to query for values to fill the blanks left between subsets.

Returns

T[,]

An array containing the copyed data. Size will be trimmed if baseValues is too small.

GetArray(T[,])

Returns the smallest possible array that encompasses all inserted subsets and can be backed by a base array.

public T[,] GetArray(T[,] baseValues)

Parameters

baseValues T[,]

An array to query for values to fill the blanks left between subsets.

Returns

T[,]

An array containing the copyed data. Size will be trimmed if baseValues is too small.