-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
55 lines (47 loc) · 1.25 KB
/
index.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
//Anuj notes: commented out functions as it cannot be stored in Firebase
export class Game {
constructor() {
this.gameFirebaseKey = null
this.gameId = null
this.players = []
this.flags = []
// this.onSession = true
}
}
export class Player {
constructor() {
this.playerId = null
this.playerKey = null
this.location = null
this.team = null
this.hasFlag = false
}
// setPosition = function(inLatitude, inLongitude) {
// this.location = {latitude: inLatitude, longitude: inLongitude}
// }
// capturedFlag = function() {
// this.hasFlag = true;
// }
// lostFlag = function() {
// this.hasFlag = false;
// this.tagged = true;
// }
// untagPlayer = function() {
// this.tagged = false;
// }
}
export class Flag {
constructor(color, num) {
this.flagId = num
this.startLocation = null
this.currentLocation = null
this.team = color
this.isTaken = false
this.holder = null
}
// flagTaken = function(player) {
// this.isTaken = true;
// this.holder = player.playerId;
// this.currentLocation = player.position;
// }
}