Tabletop.Piece (tabletop v0.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.

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?(piece1, piece2)

Checks if two pieces are the same by comparing ids.