ensl_gathers/lib/gather/gatherer.js
Chris Blanchard 10f9d5b2b9 More arrows!
2015-08-11 00:56:53 +01:00

36 lines
No EOL
689 B
JavaScript

"use strict";
/*
* Implements Gatherer
*
* Stores necessary information including:
* - user data
* - voting preferences
* - leader status
* - Team: "lobby" "alien" "marine"
*/
var User = require("../user/user");
function Gatherer (user) {
this.leaderVote = null;
this.mapVote = null;
this.serverVote = null;
this.confirm = false;
this.id = user.id;
this.user = user;
this.leader = false;
this.team = "lobby";
}
Gatherer.prototype.voteForLeader = candidate => {
if (candidate === null) {
return this.leaderVote = null;
}
if (typeof candidate === 'number') {
return this.leaderVote = candidate;
}
this.leaderVote = candidate.id;
};
module.exports = Gatherer;