33 lines
482 B
TypeScript
33 lines
482 B
TypeScript
import { Schema, type } from '@colyseus/schema'
|
|
|
|
export class Player extends Schema {
|
|
@type('string')
|
|
id: string
|
|
|
|
@type('string')
|
|
accountId: string
|
|
|
|
@type('string')
|
|
nickname: string
|
|
|
|
@type('string')
|
|
avatar: string
|
|
|
|
@type('number')
|
|
score: number
|
|
|
|
@type('number')
|
|
rank: number
|
|
|
|
team: number
|
|
@type('number')
|
|
online:number
|
|
|
|
constructor(id: string, accountId: string) {
|
|
super()
|
|
this.id = id
|
|
this.accountId = accountId
|
|
this.score = 0
|
|
}
|
|
}
|