]> git.cworth.org Git - lmno.games/commitdiff
Rename reset_state() to reset_board()
authorCarl Worth <cworth@cworth.org>
Fri, 5 Jun 2020 00:36:23 +0000 (17:36 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 5 Jun 2020 00:36:23 +0000 (17:36 -0700)
It's not resetting _all_ state, just the board.

In the past, these two notions were basically the same, (since the
board was the only state we hadd), but soon we'll be adding players
and other information outside the board, so this new naming is more
clear.

tictactoe/tictactoe.jsx

index c51727dab72f9f4172f743b2422cdaed037d20cb..153dd74a796a92fa8117bf65d537479610c2751f 100644 (file)
@@ -37,7 +37,7 @@ events.addEventListener("move", event => {
 events.addEventListener("game-state", event => {
   const state = JSON.parse(event.data);
 
-  window.game.reset_state();
+  window.game.reset_board();
 
   for (let square of state.moves) {
     window.game.receive_move(square);
@@ -127,7 +127,7 @@ class Game extends React.Component {
     return fetch_post_json("move", { move: i });
   }
 
-  reset_state() {
+  reset_board() {
     this.setState({
       history: [
         {