]> git.cworth.org Git - empires-server/commit
tictactoe: Actually toggle between X and O as the current player
authorCarl Worth <cworth@cworth.org>
Mon, 1 Jun 2020 14:30:06 +0000 (07:30 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 1 Jun 2020 14:30:06 +0000 (07:30 -0700)
commit8adcf9df208ac8d303706f89d359f69bbdc0a7a2
treeaf05f686c9d2104470ec4d4e1c220287bfaf1d7f
parent4a744b0425333284979ef76206c457ff7dcf5907
tictactoe: Actually toggle between X and O as the current player

It is kind of hilarious that I hadn't even noticed that up to now
every move committed to the board was an "X". I hadn't noticed this
because the server state is currently only used to determine if a new
move is legal, (in that the board is unoccupied). The code currently
doesn't test for a win, for example.

And meanwhile, the client has been tracking toggling X and O on its
own just fine.

But this will certainly be cleaner going forward, and is strictly
necessary before we serve an event that exposes the entire board
state.
tictactoe.js