Piece

Piece

Base class for all board pieces (Terrain, Item, Agent, Effect). All pieces are immutable — their state is set at construction and never changes. The Registry ensures that identical pieces are the same object instance.

Constructor

new Piece(name, flags, color, symbol)

Source:
Parameters:
Name Type Description
name string

Display name shown to the player

flags number

Bitmask of Flags constants

color string

CSS color string (use Color.NONE for no color)

symbol Symbol

Visual representation

Classes

Piece

Methods

is()

Description:
  • True if this piece has the given flag set.

Source:

not()

Description:
  • True if this piece does NOT have the given flag set.

Source: