TabletopPiece

Server only. A piece on a Tabletop, made with table.addPiece. It stands on a cell, on top of the pieces already there, and its prop shows it to the table's players.

tabletopPiece.id

id

The piece's id on its table.

tabletopPiece.table

table

The table it is on.

tabletopPiece.model

model

The prop model it is shown with.

tabletopPiece.prop

prop

The prop that shows it, for what Prop offers (its position while it moves, for example).

tabletopPiece.cell

cell

The cell it stands on (the one it moves to, from the start of a move).

tabletopPiece.side

side

Whose piece it is, as you gave it to addPiece; you can change it.

tabletopPiece.data

data

Your own data on the piece (a king's crown, a card's value), kept by save(). You can change it or assign a new object.

tabletopPiece.removed

removed

Whether it was taken off the board.

tabletopPiece.moveTo()

moveTo(cell, options = {})

Moves it to a cell, on top of what is there: `path` 'hop' (an arc, the default), 'slide' (along the board) or 'jump' (at once), over `ms` milliseconds (default 400, at most 5000) and `height` metres up for a hop. The promise settles true when it arrives, false if it was removed or moved again first.

tabletopPiece.showOnlyTo()

showOnlyTo(players)

Shows it to these players only (a card in a hand), or to everyone again with null.

tabletopPiece.remove()

remove()

Takes it off the board.