-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodel.js
66 lines (61 loc) · 2.57 KB
/
model.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* @author Ruben Homs <[email protected]>
* @since 11/6/12
* @version 0.1
*
* This file contains models which can be used to make
* database calls. In this file the structure of the
* documents that are inside the collections are
* also defined.
*/
/**
* {
* gamecode: 123 // 3 digit game code (string)
* team: object // The team currently playing (object)
* teams: [object, object] // The teams in the current game (array)
* clock: 42 // The time left on the clock for this round. (int)
* rounds: 5 // The number of rounds to play (int)
* category: all // The category being played. (string)
* difficulty: medium // The difficulty to play on (string)
* round: 1 // The current round (int)
* scoreConfirmed: false // Is the score already confirmed by the other party? (bool)
* handicap: 0 // The handicap for the current round (int)
* nextRound: false // Whether the next round already started.
* answers: [object->
* {answer: 'string'},
* object], // The answers for this current game and round (array)
* roundScores: [{"red": 1, "blue":0},{"red": 1, "blue":4}, etc.] // The scores for each round.
* }
* @type {Meteor.Collection}
*/
Games = new Meteor.Collection('games');
/**
* {
* _id: string // The _id of the document (also the team_id in the session) (string)
* gamecode: 123 // 3 digit game code (string)
* idle: false // Whether the player is idle or not. (bool)
* last_keepalive: Date.getTime() // The last keepalive as Epoch time. (int)
* name: Team 1 // The name of the team, if you create the game you are Team 1, if you joined you're Team 2 (string)
* score: 0 // The score of the team so far. (int)
* }
* @type {Meteor.Collection}
*/
Teams = new Meteor.Collection('teams');
/**
* {
* access_code : 1234 // The gamecode to the game. (string)
* throw : 0-2 // The throw the player made. (int)
* }
* @type {Meteor.Collection}
*/
Dice = new Meteor.Collection('dice');
/**
* {
* answer: "Christian Bale",
* category: "Acteurs",
* language: "nl",
* link: "http://www.imdb.com/ri/STARM_100/TOP/102162/name/nm0000288"
* }
* @type {Meteor.Collection}
*/
Answers = new Meteor.Collection('answers');