Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hasher ¶ added in v0.1.0
type Hasher struct {
// contains filtered or unexported fields
}
func NewHashHasher ¶ added in v0.1.0
func NewUint16Hasher ¶ added in v0.1.0
func (*Hasher) MustPutHash ¶ added in v0.1.0
func (*Hasher) MustPutUint16 ¶ added in v0.1.0
type MoveSet ¶ added in v0.1.0
type MoveSet struct {
// contains filtered or unexported fields
}
MoveSet is a thread-safe set that tracks unique moves for a specific level. When the level changes, all existing moves are cleared to prevent mixing moves from different levels.
func NewMoveSet ¶ added in v0.1.0
func NewMoveSet() *MoveSet
NewMoveSet initializes and returns a new MoveSet instance. Initial level is 0.
func (*MoveSet) Exists ¶ added in v0.1.0
Exists checks if a move exists in the set for the current level. Returns false immediately if the provided level doesn't match the set's current level. position: The game position to check. move: The move identifier to check. level: The level to verify against.
func (*MoveSet) Insert ¶ added in v0.1.0
Insert adds a move to the set. If the provided level differs from the current level, the set is cleared before adding the new move. This ensures moves are grouped by level. position: The game position represented as a 32-byte array. move: The move identifier to be serialized. level: The current level associated with the move.