BlockSideSet

value class BlockSideSet(val data: Byte)

An immutable set of BlockSide values stored as a bitmask in a single Byte.

Bit layout (MSB to LSB): - | - | BOTTOM | TOP | RIGHT | BACK | LEFT | FRONT

Constructors

Link copied to clipboard
constructor(data: Byte)
constructor(front: Boolean = false, left: Boolean = false, back: Boolean = false, right: Boolean = false, top: Boolean = false, bottom: Boolean = false)

Creates a new BlockSideSet with the sides that are set to true.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val data: Byte

Functions

Link copied to clipboard
infix fun and(other: BlockSideSet): BlockSideSet

Returns a new BlockSideSet that is the intersection of this set and other.

Link copied to clipboard
inline fun <V> associateWith(valueSelector: (BlockSide) -> V): BlockSideMap<V?>

Returns a BlockSideMap where each side in this set is associated with the value produced by valueSelector, and all other sides are null.

Link copied to clipboard
operator fun contains(side: BlockSide): Boolean

Checks whether side is contained in this set.

Link copied to clipboard
inline fun forEach(action: (BlockSide) -> Unit)

Runs action for each BlockSide contained in this set.

Link copied to clipboard

Checks whether this set contains no sides.

Link copied to clipboard

Checks whether this set contains at least one side.

Link copied to clipboard
inline fun <V> map(transform: (BlockSide) -> V): List<V>

Returns a list of results from applying transform to each BlockSide in this set.

Link copied to clipboard
operator fun minus(side: BlockSide): BlockSideSet

Returns a new BlockSideSet with side removed.

operator fun minus(other: BlockSideSet): BlockSideSet

Returns a new BlockSideSet with all sides in other removed.

Link copied to clipboard
operator fun plus(side: BlockSide): BlockSideSet

Returns a new BlockSideSet with side added.

operator fun plus(other: BlockSideSet): BlockSideSet

Returns a new BlockSideSet that is the union of this set and other.

Link copied to clipboard
fun toCubeFaceSet(front: BlockFace): CubeFaceSet

Converts this BlockSideSet to a CubeFaceSet given the front direction.