]> git.cworth.org Git - lmno.games/commit
tictactoe: Don't let the user send an illegal move
authorCarl Worth <cworth@cworth.org>
Thu, 4 Jun 2020 00:37:59 +0000 (17:37 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 4 Jun 2020 00:37:59 +0000 (17:37 -0700)
commitcd1247338dd987b8796ad5ca6d0f655ececa22ee
tree9e6f85e7d4ef8e84007ffd01d4b57792f36ca764
parent9c92603bbe96c1bb54db5247ba73e7ea447845c1
tictactoe: Don't let the user send an illegal move

The client already knows which squares are occupied, and when the game
is won, so it's pointless to ever send a move we know is going to be
rejected. And in fact, we shouldn't even give the user a hover
indication as if they could move there.

That's all implemented in this commit. The hover highlight and the
pointer cursor are both disabled for squares that are already
occupied, and for all squares once the game is over.
tictactoe/tictactoe.css
tictactoe/tictactoe.jsx