]> git.cworth.org Git - empires-server/commit
game: Add support for a static "meta" field to hold game metadata
authorCarl Worth <cworth@cworth.org>
Sun, 31 May 2020 23:34:44 +0000 (16:34 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 1 Jun 2020 00:09:57 +0000 (17:09 -0700)
commit17ceff9f690f9689f38fe3d0d448fccba72bf044
tree0732ae9fed56746987e1137788d0e32eae8400e0
parent32420152e7e4805104d5118fabc5ada0e668e5ae
game: Add support for a static "meta" field to hold game metadata

We use a static getter/setter function for this since JavaScript
doesn't yet have wide support for static fields.

Also, we duplicate the data on both a field within the class itself
(Game._meta) as well as in the prototype (Game.prototype). The purpose
of this is so that we can access this meta-data as either a class
static (Game.meta) or via an instance (some_game.meta).
game.js