mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-10 21:26:56 +01:00
cee42e7a88
* Convert to LF? * Modify gitattributes * Force LF * Git --renormalize * Update .gitattributes to enforce eol=lf * Redo CRLF -> LF on remaining files
33 lines
492 B
JavaScript
33 lines
492 B
JavaScript
export class Player {
|
|
name = ''
|
|
raw = {}
|
|
|
|
constructor (data) {
|
|
if (typeof data === 'string') {
|
|
this.name = data
|
|
} else {
|
|
const { name, ...raw } = data
|
|
if (name) this.name = name
|
|
if (raw) this.raw = raw
|
|
}
|
|
}
|
|
}
|
|
|
|
export class Players extends Array {
|
|
push (data) {
|
|
super.push(new Player(data))
|
|
}
|
|
}
|
|
|
|
export class Results {
|
|
name = ''
|
|
map = ''
|
|
password = false
|
|
|
|
raw = {}
|
|
|
|
maxplayers = 0
|
|
players = new Players()
|
|
bots = new Players()
|
|
}
|