Home Manual Reference Source Test Repository
import Piece from 'p2pboardgameapi/src/Piece.js'
public class | source

Piece

A movable game piece

Test:

Member Summary

Public Members
public

on: Object<string, Signal>

Event container

Method Summary

Public Methods
public

move(x: *, y: *)

Rolls the die to generate a number between 1 and 6

Public Members

public on: Object<string, Signal> source

Event container

Properties:

NameTypeAttributeDescription
move Signal

Event signal when the piece is moved by a client to new coordinates (Parameters: x, y)

Public Methods

public move(x: *, y: *) source

Rolls the die to generate a number between 1 and 6

Params:

NameTypeAttributeDescription
x *
y *

Emit:

move

the piece has been moved

Test: