Tabletop.Piece (tabletop v1.1.2)

This module provides the struct for representing pieces on the board as well as functions to manipulate them.

The Tabletop.Piece Struct

The public fields are:

  • id - An identifier used for display or querying
  • attributes - A map of attributes held by the piece

Link to this section Summary

Functions

Assigns the provided attributes to the piece. Any existing attributes that share a key will be overridden.

Checks if two pieces are the same by comparing ids.

Creates a new piece with the given id.

Link to this section Functions

Link to this function

assign(piece, attributes)

Assigns the provided attributes to the piece. Any existing attributes that share a key will be overridden.

Link to this function

equal?(arg1, arg2)

Checks if two pieces are the same by comparing ids.

Creates a new piece with the given id.