{"action":"created","comment":{"url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/comments/69226469","id":69226469,"diff_hunk":"@@ -4,18 +4,16 @@ import * as orbs from './orbs';\n import * as triples from './triples';\n \n export class Board {\n-    constructor (width = 8, height = 8, types = _.range(7), atticOrbs = undefined) {\n+    constructor (width = 8, height = 8, types = _.range(7), needsAttic = true) {\n         this.width = width;\n         this.height = height;\n         this.types = types;\n-        this.orbs = this.generateOrbs();\n+        this.generateOrbs();\n         if (this.hasMatch() || this.needsShuffle()) {\n             this.shuffle();\n         };\n-        if (atticOrbs) {\n-            this.atticOrbs = atticOrbs;\n-        } else {\n-            this.atticOrbs = _.cloneDeep(new Board(this.width, this.height, this.types, true).orbs);\n+        if (needsAttic) {\n+            this.attic = new Board(this.width, this.height, this.types, false);\n         };\n     }","path":"babel/src/board.js","position":21,"original_position":21,"commit_id":"c0a9336e68c46c53ebbc96975b62103dc09e068d","original_commit_id":"c0a9336e68c46c53ebbc96975b62103dc09e068d","user":{"login":"rbcasperson","id":15185836,"avatar_url":"https://avatars.githubusercontent.com/u/15185836?v=3","gravatar_id":"","url":"https://api.github.com/users/rbcasperson","html_url":"https://github.com/rbcasperson","followers_url":"https://api.github.com/users/rbcasperson/followers","following_url":"https://api.github.com/users/rbcasperson/following{/other_user}","gists_url":"https://api.github.com/users/rbcasperson/gists{/gist_id}","starred_url":"https://api.github.com/users/rbcasperson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbcasperson/subscriptions","organizations_url":"https://api.github.com/users/rbcasperson/orgs","repos_url":"https://api.github.com/users/rbcasperson/repos","events_url":"https://api.github.com/users/rbcasperson/events{/privacy}","received_events_url":"https://api.github.com/users/rbcasperson/received_events","type":"User","site_admin":false},"body":"I went with this setup. It will never create more than two boards in the constructor, thesyntax for use is nice, and the only dead-weight parameter is the `needsAttic`. I wish there was a way to not use it, not use a getter for `attic`, and not have a stack overflow, but I don't see how. I think this is pretty legible.\r\n\r\n```js\r\nb = new Board();\r\n\r\nb.attic.orbs = ['however I want to hard code the attic orbs'];\r\n\r\nb.attic.types = 'my new attic types'.split(' ');\r\nb.attic.generateOrbs();\r\n```","created_at":"2016-06-30T23:20:16Z","updated_at":"2016-06-30T23:20:16Z","html_url":"https://github.com/PlaytestersKitchen/match-three-js/pull/35#discussion_r69226469","pull_request_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/comments/69226469"},"html":{"href":"https://github.com/PlaytestersKitchen/match-three-js/pull/35#discussion_r69226469"},"pull_request":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/35","id":75537939,"html_url":"https://github.com/PlaytestersKitchen/match-three-js/pull/35","diff_url":"https://github.com/PlaytestersKitchen/match-three-js/pull/35.diff","patch_url":"https://github.com/PlaytestersKitchen/match-three-js/pull/35.patch","issue_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues/35","number":35,"state":"open","locked":false,"title":"feat(attic): Move atticOrbs from the constructor to a getter","user":{"login":"rbcasperson","id":15185836,"avatar_url":"https://avatars.githubusercontent.com/u/15185836?v=3","gravatar_id":"","url":"https://api.github.com/users/rbcasperson","html_url":"https://github.com/rbcasperson","followers_url":"https://api.github.com/users/rbcasperson/followers","following_url":"https://api.github.com/users/rbcasperson/following{/other_user}","gists_url":"https://api.github.com/users/rbcasperson/gists{/gist_id}","starred_url":"https://api.github.com/users/rbcasperson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbcasperson/subscriptions","organizations_url":"https://api.github.com/users/rbcasperson/orgs","repos_url":"https://api.github.com/users/rbcasperson/repos","events_url":"https://api.github.com/users/rbcasperson/events{/privacy}","received_events_url":"https://api.github.com/users/rbcasperson/received_events","type":"User","site_admin":false},"body":"This stops the constructor from calling tiself from within itself.\r\nInstead, whenever atticOrbs are referenced, they are created on the\r\nspot. Additionally, there is now an atticTypes parameter in the\r\nconstructor that defaults to the previously given types parameter.\r\n\r\nThis way, at any point, atticTypes can be changed, which will affect\r\nthe contents of the attic when they are called for.\r\n\r\nThis change also prevents atticOrbs from being hardcoded.","created_at":"2016-06-28T19:43:27Z","updated_at":"2016-06-30T23:20:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b94ccdba55419021e822778e34db978391440d52","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/35/commits","review_comments_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/35/comments","review_comment_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues/35/comments","statuses_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/statuses/c0a9336e68c46c53ebbc96975b62103dc09e068d","head":{"label":"PlaytestersKitchen:site","ref":"site","sha":"c0a9336e68c46c53ebbc96975b62103dc09e068d","user":{"login":"PlaytestersKitchen","id":7347739,"avatar_url":"https://avatars.githubusercontent.com/u/7347739?v=3","gravatar_id":"","url":"https://api.github.com/users/PlaytestersKitchen","html_url":"https://github.com/PlaytestersKitchen","followers_url":"https://api.github.com/users/PlaytestersKitchen/followers","following_url":"https://api.github.com/users/PlaytestersKitchen/following{/other_user}","gists_url":"https://api.github.com/users/PlaytestersKitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/PlaytestersKitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PlaytestersKitchen/subscriptions","organizations_url":"https://api.github.com/users/PlaytestersKitchen/orgs","repos_url":"https://api.github.com/users/PlaytestersKitchen/repos","events_url":"https://api.github.com/users/PlaytestersKitchen/events{/privacy}","received_events_url":"https://api.github.com/users/PlaytestersKitchen/received_events","type":"Organization","site_admin":false},"repo":{"id":53109183,"name":"match-three-js","full_name":"PlaytestersKitchen/match-three-js","owner":{"login":"PlaytestersKitchen","id":7347739,"avatar_url":"https://avatars.githubusercontent.com/u/7347739?v=3","gravatar_id":"","url":"https://api.github.com/users/PlaytestersKitchen","html_url":"https://github.com/PlaytestersKitchen","followers_url":"https://api.github.com/users/PlaytestersKitchen/followers","following_url":"https://api.github.com/users/PlaytestersKitchen/following{/other_user}","gists_url":"https://api.github.com/users/PlaytestersKitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/PlaytestersKitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PlaytestersKitchen/subscriptions","organizations_url":"https://api.github.com/users/PlaytestersKitchen/orgs","repos_url":"https://api.github.com/users/PlaytestersKitchen/repos","events_url":"https://api.github.com/users/PlaytestersKitchen/events{/privacy}","received_events_url":"https://api.github.com/users/PlaytestersKitchen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PlaytestersKitchen/match-three-js","description":"Basic logic for implementing a match three game.","fork":false,"url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js","forks_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/forks","keys_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/teams","hooks_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/hooks","issue_events_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues/events{/number}","events_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/events","assignees_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/assignees{/user}","branches_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/branches{/branch}","tags_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/tags","blobs_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/statuses/{sha}","languages_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/languages","stargazers_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/stargazers","contributors_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/contributors","subscribers_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/subscribers","subscription_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/subscription","commits_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/contents/{+path}","compare_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/merges","archive_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/downloads","issues_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues{/number}","pulls_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls{/number}","milestones_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/milestones{/number}","notifications_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/labels{/name}","releases_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/releases{/id}","deployments_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/deployments","created_at":"2016-03-04T05:12:25Z","updated_at":"2016-06-14T00:26:21Z","pushed_at":"2016-06-30T23:13:36Z","git_url":"git://github.com/PlaytestersKitchen/match-three-js.git","ssh_url":"git@github.com:PlaytestersKitchen/match-three-js.git","clone_url":"https://github.com/PlaytestersKitchen/match-three-js.git","svn_url":"https://github.com/PlaytestersKitchen/match-three-js","homepage":"http://playtesterskitchen.github.io/match-three-js/","size":303,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"PlaytestersKitchen:master","ref":"master","sha":"58ee3cd43956c97f32c336913c2e8a5f496fd850","user":{"login":"PlaytestersKitchen","id":7347739,"avatar_url":"https://avatars.githubusercontent.com/u/7347739?v=3","gravatar_id":"","url":"https://api.github.com/users/PlaytestersKitchen","html_url":"https://github.com/PlaytestersKitchen","followers_url":"https://api.github.com/users/PlaytestersKitchen/followers","following_url":"https://api.github.com/users/PlaytestersKitchen/following{/other_user}","gists_url":"https://api.github.com/users/PlaytestersKitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/PlaytestersKitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PlaytestersKitchen/subscriptions","organizations_url":"https://api.github.com/users/PlaytestersKitchen/orgs","repos_url":"https://api.github.com/users/PlaytestersKitchen/repos","events_url":"https://api.github.com/users/PlaytestersKitchen/events{/privacy}","received_events_url":"https://api.github.com/users/PlaytestersKitchen/received_events","type":"Organization","site_admin":false},"repo":{"id":53109183,"name":"match-three-js","full_name":"PlaytestersKitchen/match-three-js","owner":{"login":"PlaytestersKitchen","id":7347739,"avatar_url":"https://avatars.githubusercontent.com/u/7347739?v=3","gravatar_id":"","url":"https://api.github.com/users/PlaytestersKitchen","html_url":"https://github.com/PlaytestersKitchen","followers_url":"https://api.github.com/users/PlaytestersKitchen/followers","following_url":"https://api.github.com/users/PlaytestersKitchen/following{/other_user}","gists_url":"https://api.github.com/users/PlaytestersKitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/PlaytestersKitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PlaytestersKitchen/subscriptions","organizations_url":"https://api.github.com/users/PlaytestersKitchen/orgs","repos_url":"https://api.github.com/users/PlaytestersKitchen/repos","events_url":"https://api.github.com/users/PlaytestersKitchen/events{/privacy}","received_events_url":"https://api.github.com/users/PlaytestersKitchen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PlaytestersKitchen/match-three-js","description":"Basic logic for implementing a match three game.","fork":false,"url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js","forks_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/forks","keys_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/teams","hooks_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/hooks","issue_events_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues/events{/number}","events_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/events","assignees_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/assignees{/user}","branches_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/branches{/branch}","tags_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/tags","blobs_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/statuses/{sha}","languages_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/languages","stargazers_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/stargazers","contributors_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/contributors","subscribers_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/subscribers","subscription_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/subscription","commits_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/contents/{+path}","compare_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/merges","archive_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/downloads","issues_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues{/number}","pulls_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls{/number}","milestones_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/milestones{/number}","notifications_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/labels{/name}","releases_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/releases{/id}","deployments_url":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/deployments","created_at":"2016-03-04T05:12:25Z","updated_at":"2016-06-14T00:26:21Z","pushed_at":"2016-06-30T23:13:36Z","git_url":"git://github.com/PlaytestersKitchen/match-three-js.git","ssh_url":"git@github.com:PlaytestersKitchen/match-three-js.git","clone_url":"https://github.com/PlaytestersKitchen/match-three-js.git","svn_url":"https://github.com/PlaytestersKitchen/match-three-js","homepage":"http://playtesterskitchen.github.io/match-three-js/","size":303,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/35"},"html":{"href":"https://github.com/PlaytestersKitchen/match-three-js/pull/35"},"issue":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues/35"},"comments":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/PlaytestersKitchen/match-three-js/statuses/c0a9336e68c46c53ebbc96975b62103dc09e068d"}}}}
{"actor":{"display_login":"rbcasperson"}}