Table of Contents

Class BitFieldArray

Namespace
Shard.Gameplay.Universe.World.Chunks.Palettes
Assembly
Shard.Gameplay.Universe.dll

A packed array of length fixed-width unsigned indices, bits each, laid out LSB-first across a byte stream (Java: BitFieldArr). Index i's low bit sits at bit (ibits) % 8 of byte (ibits) / 8; a value that straddles a byte boundary spills its remaining high bits into the next byte starting at bit 0. Backing size is ceil(length*bits / 8) bytes.

public sealed class BitFieldArray
Inheritance
BitFieldArray
Inherited Members

Constructors

BitFieldArray(int, int)

public BitFieldArray(int bits, int length)

Parameters

bits int
length int

Properties

ByteLength

The packed byte length (what the wire records before the bytes).

public int ByteLength { get; }

Property Value

int

Bytes

The packed bytes, ready to copy onto the wire.

public ReadOnlySpan<byte> Bytes { get; }

Property Value

ReadOnlySpan<byte>

Length

The number of cells.

public int Length { get; }

Property Value

int

Methods

Get(int)

public int Get(int index)

Parameters

index int

Returns

int

Set(int, int)

public void Set(int index, int value)

Parameters

index int
value int