Color

dicechess.engine.domain.Models$package.Color
object Color

Represents the player colors: White (0) or Black (1).

Uses bitwise XOR for fast toggling between opponents.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Color.type

Members list

Value members

Concrete methods

def apply(value: Int): Color

Safe builder to validate boundary invariants.

Safe builder to validate boundary invariants.

Attributes

Concrete fields

val Black: Color
val White: Color

Extensions

Extensions

extension (color: Color)
inline def isBlack: Boolean

Returns true when this color is Black.

Returns true when this color is Black.

Attributes

inline def isWhite: Boolean

Returns true when this color is White.

Returns true when this color is White.

Attributes

inline def opponent: Color

Returns the opposing color. Implemented as XOR for branch-free toggling.

Returns the opposing color. Implemented as XOR for branch-free toggling.

Attributes

inline def value: Int

Exposes the underlying Int value (0 = White, 1 = Black).

Exposes the underlying Int value (0 = White, 1 = Black).

Attributes