{"action":"created","comment":{"url":"https://api.github.com/repos/google/boardgame.io/pulls/comments/175421501","pull_request_review_id":104945523,"id":175421501,"diff_hunk":"@@ -106,6 +106,10 @@ export function createGameReducer({ game, numPlayers, multiplayer }) {\n         // Detach Events API from ctx.\n         ctx = Events.detach(ctx);\n \n+        if (action.payload.type === 'resetGame') {","path":"src/core/reducer.js","position":4,"original_position":4,"commit_id":"38128224cd04123c4c8fa78aebfb27f4eca83d51","original_commit_id":"38128224cd04123c4c8fa78aebfb27f4eca83d51","user":{"login":"sladwig","id":79246,"avatar_url":"https://avatars3.githubusercontent.com/u/79246?v=4","gravatar_id":"","url":"https://api.github.com/users/sladwig","html_url":"https://github.com/sladwig","followers_url":"https://api.github.com/users/sladwig/followers","following_url":"https://api.github.com/users/sladwig/following{/other_user}","gists_url":"https://api.github.com/users/sladwig/gists{/gist_id}","starred_url":"https://api.github.com/users/sladwig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sladwig/subscriptions","organizations_url":"https://api.github.com/users/sladwig/orgs","repos_url":"https://api.github.com/users/sladwig/repos","events_url":"https://api.github.com/users/sladwig/events{/privacy}","received_events_url":"https://api.github.com/users/sladwig/received_events","type":"User","site_admin":false},"body":"I had a quick look, my first impression is that it's far more special treatment, when we don't treat `resetGame` as a normal `gameEvent`. As I understand it `RESTORE` is used for the debug component and is not really a `gameEvent` like `endGame`, thus not (directly) available from within the game, when the debug component is deactivated. So if I understand correctly I would have to add extra logic to the flow object (and introducing API and stuff) just to support 'another type' of game event just to reset the game. I am not sure if we want this (correct me if I'm wrong or misunderstood what you mean with analogous to `RESTORE`).  \r\n\r\nOne simple solution could be to leave the log and stateID intact, this way we don't have a special treatment and also don't lose the history of the log and so the information that the game has been reset. Also stateID would be 'unique', so stateID 1 would be always the first move of the first game and never the state after a reset.\r\n\r\n","created_at":"2018-03-19T12:46:55Z","updated_at":"2018-03-19T12:46:55Z","html_url":"https://github.com/google/boardgame.io/pull/155#discussion_r175421501","pull_request_url":"https://api.github.com/repos/google/boardgame.io/pulls/155","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/google/boardgame.io/pulls/comments/175421501"},"html":{"href":"https://github.com/google/boardgame.io/pull/155#discussion_r175421501"},"pull_request":{"href":"https://api.github.com/repos/google/boardgame.io/pulls/155"}},"in_reply_to_id":175384725},"pull_request":{"url":"https://api.github.com/repos/google/boardgame.io/pulls/155","id":175760136,"html_url":"https://github.com/google/boardgame.io/pull/155","diff_url":"https://github.com/google/boardgame.io/pull/155.diff","patch_url":"https://github.com/google/boardgame.io/pull/155.patch","issue_url":"https://api.github.com/repos/google/boardgame.io/issues/155","number":155,"state":"open","locked":false,"title":"Reset Game","user":{"login":"sladwig","id":79246,"avatar_url":"https://avatars3.githubusercontent.com/u/79246?v=4","gravatar_id":"","url":"https://api.github.com/users/sladwig","html_url":"https://github.com/sladwig","followers_url":"https://api.github.com/users/sladwig/followers","following_url":"https://api.github.com/users/sladwig/following{/other_user}","gists_url":"https://api.github.com/users/sladwig/gists{/gist_id}","starred_url":"https://api.github.com/users/sladwig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sladwig/subscriptions","organizations_url":"https://api.github.com/users/sladwig/orgs","repos_url":"https://api.github.com/users/sladwig/repos","events_url":"https://api.github.com/users/sladwig/events{/privacy}","received_events_url":"https://api.github.com/users/sladwig/received_events","type":"User","site_admin":false},"body":"This PR adds a new resetGame event, which as the name may suggest resets the game.\r\n\r\nSee discussion in #95 \r\n\r\nI was not sure where to add documentation for this, will update the docs when I know where.\r\n\r\n#### Checklist\r\n\r\n* [x] Use a separate branch in your local repo (not `master`).\r\n* [x] Test coverage is 100% (or you have a story for why it's ok).\r\n","created_at":"2018-03-18T16:33:41Z","updated_at":"2018-03-19T12:46:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f229696fcf65021ccf396c9e6779d708d9f88054","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/boardgame.io/pulls/155/commits","review_comments_url":"https://api.github.com/repos/google/boardgame.io/pulls/155/comments","review_comment_url":"https://api.github.com/repos/google/boardgame.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/boardgame.io/issues/155/comments","statuses_url":"https://api.github.com/repos/google/boardgame.io/statuses/38128224cd04123c4c8fa78aebfb27f4eca83d51","head":{"label":"sladwig:resetGame","ref":"resetGame","sha":"38128224cd04123c4c8fa78aebfb27f4eca83d51","user":{"login":"sladwig","id":79246,"avatar_url":"https://avatars3.githubusercontent.com/u/79246?v=4","gravatar_id":"","url":"https://api.github.com/users/sladwig","html_url":"https://github.com/sladwig","followers_url":"https://api.github.com/users/sladwig/followers","following_url":"https://api.github.com/users/sladwig/following{/other_user}","gists_url":"https://api.github.com/users/sladwig/gists{/gist_id}","starred_url":"https://api.github.com/users/sladwig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sladwig/subscriptions","organizations_url":"https://api.github.com/users/sladwig/orgs","repos_url":"https://api.github.com/users/sladwig/repos","events_url":"https://api.github.com/users/sladwig/events{/privacy}","received_events_url":"https://api.github.com/users/sladwig/received_events","type":"User","site_admin":false},"repo":{"id":120831014,"name":"boardgame.io","full_name":"sladwig/boardgame.io","owner":{"login":"sladwig","id":79246,"avatar_url":"https://avatars3.githubusercontent.com/u/79246?v=4","gravatar_id":"","url":"https://api.github.com/users/sladwig","html_url":"https://github.com/sladwig","followers_url":"https://api.github.com/users/sladwig/followers","following_url":"https://api.github.com/users/sladwig/following{/other_user}","gists_url":"https://api.github.com/users/sladwig/gists{/gist_id}","starred_url":"https://api.github.com/users/sladwig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sladwig/subscriptions","organizations_url":"https://api.github.com/users/sladwig/orgs","repos_url":"https://api.github.com/users/sladwig/repos","events_url":"https://api.github.com/users/sladwig/events{/privacy}","received_events_url":"https://api.github.com/users/sladwig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sladwig/boardgame.io","description":"State management and more for turn based games.","fork":true,"url":"https://api.github.com/repos/sladwig/boardgame.io","forks_url":"https://api.github.com/repos/sladwig/boardgame.io/forks","keys_url":"https://api.github.com/repos/sladwig/boardgame.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sladwig/boardgame.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sladwig/boardgame.io/teams","hooks_url":"https://api.github.com/repos/sladwig/boardgame.io/hooks","issue_events_url":"https://api.github.com/repos/sladwig/boardgame.io/issues/events{/number}","events_url":"https://api.github.com/repos/sladwig/boardgame.io/events","assignees_url":"https://api.github.com/repos/sladwig/boardgame.io/assignees{/user}","branches_url":"https://api.github.com/repos/sladwig/boardgame.io/branches{/branch}","tags_url":"https://api.github.com/repos/sladwig/boardgame.io/tags","blobs_url":"https://api.github.com/repos/sladwig/boardgame.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sladwig/boardgame.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sladwig/boardgame.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/sladwig/boardgame.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sladwig/boardgame.io/statuses/{sha}","languages_url":"https://api.github.com/repos/sladwig/boardgame.io/languages","stargazers_url":"https://api.github.com/repos/sladwig/boardgame.io/stargazers","contributors_url":"https://api.github.com/repos/sladwig/boardgame.io/contributors","subscribers_url":"https://api.github.com/repos/sladwig/boardgame.io/subscribers","subscription_url":"https://api.github.com/repos/sladwig/boardgame.io/subscription","commits_url":"https://api.github.com/repos/sladwig/boardgame.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/sladwig/boardgame.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/sladwig/boardgame.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/sladwig/boardgame.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/sladwig/boardgame.io/contents/{+path}","compare_url":"https://api.github.com/repos/sladwig/boardgame.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sladwig/boardgame.io/merges","archive_url":"https://api.github.com/repos/sladwig/boardgame.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sladwig/boardgame.io/downloads","issues_url":"https://api.github.com/repos/sladwig/boardgame.io/issues{/number}","pulls_url":"https://api.github.com/repos/sladwig/boardgame.io/pulls{/number}","milestones_url":"https://api.github.com/repos/sladwig/boardgame.io/milestones{/number}","notifications_url":"https://api.github.com/repos/sladwig/boardgame.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sladwig/boardgame.io/labels{/name}","releases_url":"https://api.github.com/repos/sladwig/boardgame.io/releases{/id}","deployments_url":"https://api.github.com/repos/sladwig/boardgame.io/deployments","created_at":"2018-02-08T23:31:11Z","updated_at":"2018-03-18T15:59:01Z","pushed_at":"2018-03-19T06:30:20Z","git_url":"git://github.com/sladwig/boardgame.io.git","ssh_url":"git@github.com:sladwig/boardgame.io.git","clone_url":"https://github.com/sladwig/boardgame.io.git","svn_url":"https://github.com/sladwig/boardgame.io","homepage":"http://boardgame.io/","size":2476,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"8c6fee1d3913ac0cf6691080259eaf56f5e0bf88","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":111614342,"name":"boardgame.io","full_name":"google/boardgame.io","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/boardgame.io","description":"State management and more for turn based games.","fork":false,"url":"https://api.github.com/repos/google/boardgame.io","forks_url":"https://api.github.com/repos/google/boardgame.io/forks","keys_url":"https://api.github.com/repos/google/boardgame.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/boardgame.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/boardgame.io/teams","hooks_url":"https://api.github.com/repos/google/boardgame.io/hooks","issue_events_url":"https://api.github.com/repos/google/boardgame.io/issues/events{/number}","events_url":"https://api.github.com/repos/google/boardgame.io/events","assignees_url":"https://api.github.com/repos/google/boardgame.io/assignees{/user}","branches_url":"https://api.github.com/repos/google/boardgame.io/branches{/branch}","tags_url":"https://api.github.com/repos/google/boardgame.io/tags","blobs_url":"https://api.github.com/repos/google/boardgame.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/boardgame.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/boardgame.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/boardgame.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/boardgame.io/statuses/{sha}","languages_url":"https://api.github.com/repos/google/boardgame.io/languages","stargazers_url":"https://api.github.com/repos/google/boardgame.io/stargazers","contributors_url":"https://api.github.com/repos/google/boardgame.io/contributors","subscribers_url":"https://api.github.com/repos/google/boardgame.io/subscribers","subscription_url":"https://api.github.com/repos/google/boardgame.io/subscription","commits_url":"https://api.github.com/repos/google/boardgame.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/boardgame.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/boardgame.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/boardgame.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/boardgame.io/contents/{+path}","compare_url":"https://api.github.com/repos/google/boardgame.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/boardgame.io/merges","archive_url":"https://api.github.com/repos/google/boardgame.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/boardgame.io/downloads","issues_url":"https://api.github.com/repos/google/boardgame.io/issues{/number}","pulls_url":"https://api.github.com/repos/google/boardgame.io/pulls{/number}","milestones_url":"https://api.github.com/repos/google/boardgame.io/milestones{/number}","notifications_url":"https://api.github.com/repos/google/boardgame.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/boardgame.io/labels{/name}","releases_url":"https://api.github.com/repos/google/boardgame.io/releases{/id}","deployments_url":"https://api.github.com/repos/google/boardgame.io/deployments","created_at":"2017-11-21T23:47:35Z","updated_at":"2018-03-19T11:50:39Z","pushed_at":"2018-03-19T11:50:37Z","git_url":"git://github.com/google/boardgame.io.git","ssh_url":"git@github.com:google/boardgame.io.git","clone_url":"https://github.com/google/boardgame.io.git","svn_url":"https://github.com/google/boardgame.io","homepage":"http://boardgame.io/","size":2499,"stargazers_count":5967,"watchers_count":5967,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":284,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":284,"open_issues":15,"watchers":5967,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/boardgame.io/pulls/155"},"html":{"href":"https://github.com/google/boardgame.io/pull/155"},"issue":{"href":"https://api.github.com/repos/google/boardgame.io/issues/155"},"comments":{"href":"https://api.github.com/repos/google/boardgame.io/issues/155/comments"},"review_comments":{"href":"https://api.github.com/repos/google/boardgame.io/pulls/155/comments"},"review_comment":{"href":"https://api.github.com/repos/google/boardgame.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/boardgame.io/pulls/155/commits"},"statuses":{"href":"https://api.github.com/repos/google/boardgame.io/statuses/38128224cd04123c4c8fa78aebfb27f4eca83d51"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sladwig"}}