Table of Contents

Class SwiftBoolArray2D

Namespace
SwiftCollections.Dimensions
Assembly
SwiftCollections.dll

Represents a 2D array specifically designed to handle boolean values.

[JsonConverter(typeof(StateJsonConverterFactory))]
[MemoryPackable(GenerateType.Object)]
public class SwiftBoolArray2D : SwiftArray2D<bool>, IEnumerable<bool>, IEnumerable, IMemoryPackable<SwiftArray2D<bool>>, IStateBacked<Array2DState<bool>>, IMemoryPackable<SwiftBoolArray2D>, IMemoryPackFormatterRegister
Inheritance
SwiftBoolArray2D
Implements
IMemoryPackable<SwiftArray2D<bool>>
IStateBacked<Array2DState<bool>>
IMemoryPackable<SwiftBoolArray2D>
IMemoryPackFormatterRegister
Inherited Members
Extension Methods

Remarks

MemoryPack GenerateType: Object

SwiftCollections.Array2DState<bool> State

Constructors

SwiftBoolArray2D()

Initializes a new instance of the SwiftBoolArray2D class.

public SwiftBoolArray2D()

SwiftBoolArray2D(Array2DState<bool>)

Initializes a new instance of the SwiftBoolArray2D class using the specified array state.

[MemoryPackConstructor]
public SwiftBoolArray2D(Array2DState<bool> state)

Parameters

state Array2DState<bool>

The state object containing the two-dimensional array data and configuration to initialize the array.

SwiftBoolArray2D(bool[,])

Initializes a new instance of the SwiftBoolArray2D class using the specified two-dimensional Boolean array as the source data.

public SwiftBoolArray2D(bool[,] source)

Parameters

source bool[,]

A two-dimensional array of Boolean values to initialize the array with. Cannot be null.

SwiftBoolArray2D(int, int)

Initializes a new instance of the SwiftBoolArray2D class with the specified dimensions.

public SwiftBoolArray2D(int width, int height)

Parameters

width int

The number of columns in the two-dimensional array. Must be greater than zero.

height int

The number of rows in the two-dimensional array. Must be greater than zero.

SwiftBoolArray2D(int, int, bool)

Initializes a new instance of the SwiftBoolArray2D class with the specified dimensions and default value.

public SwiftBoolArray2D(int width, int height, bool defaultValue)

Parameters

width int

The number of columns in the two-dimensional array. Must be greater than zero.

height int

The number of rows in the two-dimensional array. Must be greater than zero.

defaultValue bool

The initial boolean value assigned to each element in the array.

Methods

CountTrue()

Counts the number of true values in the array.

public int CountTrue()

Returns

int

SetRegion(int, int, int, int, bool)

Sets all values within a rectangular region to the specified value.

public void SetRegion(int xStart, int yStart, int width, int height, bool value)

Parameters

xStart int
yStart int
width int
height int
value bool

Toggle(int, int)

Toggles the value at the specified position in the array.

public void Toggle(int x, int y)

Parameters

x int
y int