From 47118511015be30e5efb9131f3a6a77828c0fb6a Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 4 Jun 2020 17:36:23 -0700 Subject: [PATCH] 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. --- tictactoe/tictactoe.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: [ { -- 2.43.0