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

Die

A six sided die

Test:

Member Summary

Public Members
public

The die's faces

public

If the die is currently rolling

public

on: Object<string, Signal>

Event container

Method Summary

Public Methods
public

roll()

Rolls the die to determine a random die face

Public Members

public dieFaces: DieFace[] source

The die's faces

public isRolling: boolean source

If the die is currently rolling

public on: Object<string, Signal> source

Event container

Properties:

NameTypeAttributeDescription
error Signal

Event signal for asynchronous errors (Parameters: error)

rollStart Signal

Event signal when the die starts rolling (No parameters)

rollFinish Signal

Event signal when the die finishes rolling (Parameters: face)

Public Methods

public roll() source

Rolls the die to determine a random die face

Emit:

error

when an connection error occured or the result could not be decrypted

Test: