feat(Game): add toString method

Backported from commit: 016526486c
PR: #2313
This commit is contained in:
SpaceEEC
2018-05-09 16:08:59 +02:00
parent 15a8e17710
commit c0ca73a40c

View File

@@ -73,6 +73,14 @@ class Game {
return this.type === 1;
}
/**
* When concatenated with a string, this automatically returns the game's name instead of the Game object.
* @returns {string}
*/
toString() {
return this.name;
}
/**
* Whether this game is equal to another game
* @param {Game} game The game to compare with