Mailbox
dicechess.engine.domain.Models$package.Mailbox
object Mailbox
A fast, flat array representation of the 64 squares on the board.
Gives O(1) piece lookup and near-instant cloning via System.arraycopy without GC allocations.
Attributes
- Source
- Models.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Mailbox.type
Members list
Value members
Concrete methods
Returns a completely empty mailbox.
Creates a mailbox directly from a mutated builder array.
Creates a mailbox directly from a mutated builder array.
Attributes
- Note
-
Mutating the
builderafter calling this method breaks the immutability guarantee. - Source
- Models.scala
Extensions
Extensions
extension (mb: Mailbox)
Fast O(1) retrieval of the piece at sq. Returns Piece.Empty if square is unoccupied.
Fast O(1) retrieval of the piece at sq. Returns Piece.Empty if square is unoccupied.
Attributes
- Source
- Models.scala
Optional retrieval of the piece at sq (for legacy compatibility).
Exposes the underlying immutable array for cloning.
In this article