]> git.cworth.org Git - empires-server/commitdiff
Move some checks from TicTacToe.add_move to Game.add_move
authorCarl Worth <cworth@cworth.org>
Fri, 5 Jun 2020 20:56:45 +0000 (13:56 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 5 Jun 2020 21:00:55 +0000 (14:00 -0700)
Specifically, the checks for whether the player who submitted a move
belongs on a team and belongs to the team that has the next move.

These checks belong in the generic Game class so that future games
won't have to maintain their own copies of these implementations.

Previously, we were using the presence of the "add_move" property on a
game class to determine whether to add the "/move" route. Now that we
are adding add_move to the base class, we have to check specifically
whether the child class has its own add_move (with
hasOwnProperty('add_move')) to know whether the "/move" route should
be added.


No differences found