aboutsummaryrefslogtreecommitdiff
path: root/draughts/environment.js
blob: 5f99d4d34525f2f4235d8ec630be38898f4ab071 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Signature:
 *     this.games :: Game[]
 *
 * Description:
 *     An admittedly useless class that mostly exists as a result of code evolution and rewriting. It
 *     holds an array containing all of the games that are currently ongoing.
 */
const Environment = function() {
	this.games = []
}

/*
 * Signature:
 *     (Game) => Nothing
 *
 * Description:
 *     Removes the game `game' from the array `this.games'
 */
Environment.prototype.removeGame = function(game) {
	this.games = this.games.filter(g => g != game)
}

module.exports = Environment