2022-05-24 20:26:04 +02:00
|
|
|
class Crown {
|
2021-05-09 10:52:41 +02:00
|
|
|
constructor (id, _id) {
|
|
|
|
this.participantId = id;
|
|
|
|
this.userId = _id;
|
|
|
|
this.time = Date.now();
|
|
|
|
this.startPos = {
|
|
|
|
x: 50,
|
|
|
|
y: 50
|
|
|
|
}
|
|
|
|
this.endPos = {
|
|
|
|
x: Crown.generateRandomPos(),
|
|
|
|
y: Crown.generateRandomPos()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static generateRandomPos() {
|
|
|
|
return Math.floor(Math.random() * 10000) / 100;
|
|
|
|
}
|
|
|
|
}
|
2022-05-24 20:26:04 +02:00
|
|
|
|
|
|
|
module.exports = Crown;
|
|
|
|
|