From: Carl Worth Date: Fri, 5 Jun 2020 00:36:23 +0000 (-0700) Subject: Rename reset_state() to reset_board() X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=commitdiff_plain;h=47118511015be30e5efb9131f3a6a77828c0fb6a;hp=74237cfd16350e21b67660f7ea9c3dc91e0bf10a Rename reset_state() to reset_board() 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. --- diff --git a/tictactoe/tictactoe.jsx b/tictactoe/tictactoe.jsx index c51727d..153dd74 100644 --- a/tictactoe/tictactoe.jsx +++ b/tictactoe/tictactoe.jsx @@ -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: [ {