-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.js
50 lines (40 loc) · 933 Bytes
/
models.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function Game() {
this.players = [];
this.boards = [];
this.answersAccepted = false;
this.playersThatHaveAnswered = [];
this.currentQuestion;
this.currentQuestionElement;
}
Game.prototype.playerHasAnswered = function(player) {
// See if player is already in this.playersThatHaveAnswered…
for(var i = 0; i < this.players.length; i++) {
if(this.playersThatHaveAnswered[i] === player) return true;
}
return false;
}
function Board() {
this.categories = [];
this.questionsShown = 0;
}
Board.prototype.hasShownAllQuestions = function() {
if(this.questionsShown >= this.questions.length) {
return true;
}
return false;
}
function Category() {
this.title = "Undefined Category";
this.questions = [];
}
function Question() {
this.title = "Undefined question";
this.points = 0;
this.shown = false;
}
function Player() {
this.score = 0;
};
Player.prototype.playSound = function() {
// Play dat sound!
}