Class Array2D<T>
Inheritance
System.Object
Array2D<T>
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.ICloneable
Assembly: Eco.Shared.dll
Syntax
[Serialized]
public class Array2D<T> : Object, IEnumerable<T>, IEnumerable, ICloneable
Type Parameters
Constructors
Array2D()
Declaration
Array2D(Vector2i)
Declaration
public Array2D(Vector2i size)
Parameters
Array2D(Array2D<T>)
Declaration
public Array2D(Array2D<T> other)
Parameters
Type |
Name |
Description |
Array2D<T> |
other |
|
Properties
Array
Declaration
[Serialized]
public T[] Array { get; set; }
Property Value
CalcSize
Declaration
public int CalcSize { get; }
Property Value
Type |
Description |
System.Int32 |
|
Item[Vector2i]
Declaration
public T this[Vector2i v] { get; set; }
Parameters
Property Value
Item[WorldPosition3i]
Declaration
public T this[WorldPosition3i v] { get; set; }
Parameters
Property Value
Item[Int32]
Declaration
public T this[int index] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Property Value
Item[Int32, Int32]
Declaration
public T this[int x, int y] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
Property Value
Length
Declaration
public int Length { get; }
Property Value
Type |
Description |
System.Int32 |
|
Size
Declaration
[Serialized]
public Vector2i Size { get; set; }
Property Value
Methods
Clear()
Declaration
Clone()
Declaration
Returns
Type |
Description |
System.Object |
|
Fill(T)
Declaration
public void Fill(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
ForEach(Action<Vector2i, T>)
Declaration
public void ForEach(Action<Vector2i, T> func)
Parameters
Type |
Name |
Description |
System.Action<Vector2i, T> |
func |
|
ForEachRef(ActionRef<T, Vector2i>)
Runs a function on each entry, but accepts the value by ref so it can change the array
Declaration
public void ForEachRef(ActionRef<T, Vector2i> func)
Parameters
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<T> |
|
GetRef(Vector2i)
Declaration
public ref T GetRef(Vector2i pos)
Parameters
Returns
Index(Vector2i)
Declaration
public int Index(Vector2i v)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Index(Int32, Int32)
Declaration
public int Index(int x, int y)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
Returns
Type |
Description |
System.Int32 |
|
Index(Int32, Int32, Int32)
Declaration
public static int Index(int x, int y, int size)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
System.Int32 |
size |
|
Returns
Type |
Description |
System.Int32 |
|
IndexToPos(Int32)
Declaration
public Vector2i IndexToPos(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
ReadFromStream(MemoryStream)
Declaration
public static Array2D<T> ReadFromStream(MemoryStream stream)
Parameters
Type |
Name |
Description |
System.IO.MemoryStream |
stream |
|
Returns
Select<TOut>(Func<Vector2i, T, TOut>)
Transforms the map using the given transformation function.
Declaration
public IEnumerable<TOut> Select<TOut>(Func<Vector2i, T, TOut> func)
Parameters
Type |
Name |
Description |
System.Func<Vector2i, T, TOut> |
func |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TOut> |
|
Type Parameters
Val(Vector2i)
Declaration
Parameters
Returns
Val(Int32)
Declaration
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Implements
System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable
System.ICloneable
Extension Methods