export type DiceType = "plain" | "lake" | "forest" ; export interface DiceData { type : DiceType ; sid : string ; } export default class Dice { static fromJSON < T > ( this , data ) { return new this ( data . type , data . sid ) ; } constructor ( readonly _type , readonly _sid ) { } toJSON ( ) { return { type : this . _type , sid : this . _sid } ; } }