{"action":"created","comment":{"url":"https://api.github.com/repos/4cade/AngryCartels/pulls/comments/93813688","pull_request_review_id":14350308,"id":93813688,"diff_hunk":"@@ -0,0 +1,117 @@\n+// trying to move to ES6\n+\n+/* Player object stores the state of a player and has functions to update state.\n+ * @param name String name of the player\n+ * @param startingSpace String name of the starting location of the player (usually Go)\n+ * @param startingTrack index of the starting track of the player (usually Go's track)\n+ */\n+class Player {\n+\n+    // set up initial state\n+    constructor(name, startingSpace, startingTrack) {\n+        this.name = name;\n+        this.money = 3200;\n+        this.properties = []; // list of Property Objects\n+        this.busTickets = {}; // key of bus ticket type to quantity\n+        this.forward = true;\n+        this.location = startingSpace; // all players start on go\n+        this.specialCards = [] // list of special cards acquired via chance/community chest\n+    }\n+\n+    /* @return JSON representation without functions\n+     */\n+    toJSON() {\n+        // TODO\n+    }\n+\n+    /* Calculates the net worth of the player\n+     * \n+     * @return int net worth of the player\n+     */\n+    getNetWorth() {\n+        let worth = this.money\n+\n+        for (let property in this.properties){\n+            worth += property.getValue()\n+        }\n+\n+        return worth\n+    }\n+\n+    /* Determines if the player can afford to buy item of amt, but doesn't change amount of money\n+     * @param amt - numerical amount of money to check affordability with\n+     * @return true if player can afford, false otherwise\n+     */\n+    canAfford(amt){\n+        return this.money - amt >= 0\n+    }\n+\n+    /* The player acquires the specified property.\n+     * @param property Object of the property\n+     */\n+    gainProperty(property) {\n+        this.properties.push(property)\n+    }\n+\n+    /* The player loses the specified property.\n+     * @param property Object of the property\n+     */\n+    loseProperty(property) {\n+        let index = this.properties.indexof(property)\n+        this.properties.splice(index, 1)\n+    }\n+\n+    /* The player's money changes by a certain amount.\n+     * @param amt number amount of money to change by (can be pos/neg)\n+     *\n+     * @return true if player still has money left, false if negative (bankrupt)\n+     */\n+    deltaMoney(amt) {\n+        this.money += amt\n+        return this.money >= 0\n+    }\n+\n+    /* The player acquires the specified bus pass.\n+     * @param pass String name of the bus pass\n+     */\n+    gainBusPass(pass) {\n+        this.busTickets.push(pass)\n+    }\n+\n+    /* The player uses the specified bus pass and loses it.\n+     * @param pass String name of the bus pass\n+     */\n+    useBusPass(pass) {\n+        // TODO: implement the ticket usage\n+        let index = this.busTickets.indexof(pass)\n+        this.busTickets.splice(index, 1)","path":"backend/player.js","position":null,"original_position":87,"commit_id":"ed0cec17ed8cc45a2f99c8ad60caf1ef60a11844","original_commit_id":"e795145f94e5222bf52605e697b4e75b3cba5db4","user":{"login":"Se7ensins1","id":22284231,"avatar_url":"https://avatars.githubusercontent.com/u/22284231?v=3","gravatar_id":"","url":"https://api.github.com/users/Se7ensins1","html_url":"https://github.com/Se7ensins1","followers_url":"https://api.github.com/users/Se7ensins1/followers","following_url":"https://api.github.com/users/Se7ensins1/following{/other_user}","gists_url":"https://api.github.com/users/Se7ensins1/gists{/gist_id}","starred_url":"https://api.github.com/users/Se7ensins1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Se7ensins1/subscriptions","organizations_url":"https://api.github.com/users/Se7ensins1/orgs","repos_url":"https://api.github.com/users/Se7ensins1/repos","events_url":"https://api.github.com/users/Se7ensins1/events{/privacy}","received_events_url":"https://api.github.com/users/Se7ensins1/received_events","type":"User","site_admin":false},"body":"now theyre all JSONs.\r\nfixed! +1","created_at":"2016-12-24T06:44:47Z","updated_at":"2016-12-24T06:44:47Z","html_url":"https://github.com/4cade/AngryCartels/pull/3#discussion_r93813688","pull_request_url":"https://api.github.com/repos/4cade/AngryCartels/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/4cade/AngryCartels/pulls/comments/93813688"},"html":{"href":"https://github.com/4cade/AngryCartels/pull/3#discussion_r93813688"},"pull_request":{"href":"https://api.github.com/repos/4cade/AngryCartels/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/4cade/AngryCartels/pulls/3","id":99209435,"html_url":"https://github.com/4cade/AngryCartels/pull/3","diff_url":"https://github.com/4cade/AngryCartels/pull/3.diff","patch_url":"https://github.com/4cade/AngryCartels/pull/3.patch","issue_url":"https://api.github.com/repos/4cade/AngryCartels/issues/3","number":3,"state":"open","locked":false,"title":"New Backend Architecture","user":{"login":"exsmiley","id":9023483,"avatar_url":"https://avatars.githubusercontent.com/u/9023483?v=3","gravatar_id":"","url":"https://api.github.com/users/exsmiley","html_url":"https://github.com/exsmiley","followers_url":"https://api.github.com/users/exsmiley/followers","following_url":"https://api.github.com/users/exsmiley/following{/other_user}","gists_url":"https://api.github.com/users/exsmiley/gists{/gist_id}","starred_url":"https://api.github.com/users/exsmiley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exsmiley/subscriptions","organizations_url":"https://api.github.com/users/exsmiley/orgs","repos_url":"https://api.github.com/users/exsmiley/repos","events_url":"https://api.github.com/users/exsmiley/events{/privacy}","received_events_url":"https://api.github.com/users/exsmiley/received_events","type":"User","site_admin":false},"body":"- Cleans up the code by separating the Game class into several components\r\n- Migrates the code to ES6","created_at":"2016-12-23T07:09:14Z","updated_at":"2016-12-24T06:44:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4379c5d02c7bafeccfd6ad82ab7c4906aefe49e5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/4cade/AngryCartels/pulls/3/commits","review_comments_url":"https://api.github.com/repos/4cade/AngryCartels/pulls/3/comments","review_comment_url":"https://api.github.com/repos/4cade/AngryCartels/pulls/comments{/number}","comments_url":"https://api.github.com/repos/4cade/AngryCartels/issues/3/comments","statuses_url":"https://api.github.com/repos/4cade/AngryCartels/statuses/ed0cec17ed8cc45a2f99c8ad60caf1ef60a11844","head":{"label":"4cade:backv2","ref":"backv2","sha":"ed0cec17ed8cc45a2f99c8ad60caf1ef60a11844","user":{"login":"4cade","id":24379445,"avatar_url":"https://avatars.githubusercontent.com/u/24379445?v=3","gravatar_id":"","url":"https://api.github.com/users/4cade","html_url":"https://github.com/4cade","followers_url":"https://api.github.com/users/4cade/followers","following_url":"https://api.github.com/users/4cade/following{/other_user}","gists_url":"https://api.github.com/users/4cade/gists{/gist_id}","starred_url":"https://api.github.com/users/4cade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4cade/subscriptions","organizations_url":"https://api.github.com/users/4cade/orgs","repos_url":"https://api.github.com/users/4cade/repos","events_url":"https://api.github.com/users/4cade/events{/privacy}","received_events_url":"https://api.github.com/users/4cade/received_events","type":"Organization","site_admin":false},"repo":{"id":45231513,"name":"AngryCartels","full_name":"4cade/AngryCartels","owner":{"login":"4cade","id":24379445,"avatar_url":"https://avatars.githubusercontent.com/u/24379445?v=3","gravatar_id":"","url":"https://api.github.com/users/4cade","html_url":"https://github.com/4cade","followers_url":"https://api.github.com/users/4cade/followers","following_url":"https://api.github.com/users/4cade/following{/other_user}","gists_url":"https://api.github.com/users/4cade/gists{/gist_id}","starred_url":"https://api.github.com/users/4cade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4cade/subscriptions","organizations_url":"https://api.github.com/users/4cade/orgs","repos_url":"https://api.github.com/users/4cade/repos","events_url":"https://api.github.com/users/4cade/events{/privacy}","received_events_url":"https://api.github.com/users/4cade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4cade/AngryCartels","description":"Online Multiplayer Monopoly-like game","fork":false,"url":"https://api.github.com/repos/4cade/AngryCartels","forks_url":"https://api.github.com/repos/4cade/AngryCartels/forks","keys_url":"https://api.github.com/repos/4cade/AngryCartels/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4cade/AngryCartels/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4cade/AngryCartels/teams","hooks_url":"https://api.github.com/repos/4cade/AngryCartels/hooks","issue_events_url":"https://api.github.com/repos/4cade/AngryCartels/issues/events{/number}","events_url":"https://api.github.com/repos/4cade/AngryCartels/events","assignees_url":"https://api.github.com/repos/4cade/AngryCartels/assignees{/user}","branches_url":"https://api.github.com/repos/4cade/AngryCartels/branches{/branch}","tags_url":"https://api.github.com/repos/4cade/AngryCartels/tags","blobs_url":"https://api.github.com/repos/4cade/AngryCartels/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4cade/AngryCartels/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4cade/AngryCartels/git/refs{/sha}","trees_url":"https://api.github.com/repos/4cade/AngryCartels/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4cade/AngryCartels/statuses/{sha}","languages_url":"https://api.github.com/repos/4cade/AngryCartels/languages","stargazers_url":"https://api.github.com/repos/4cade/AngryCartels/stargazers","contributors_url":"https://api.github.com/repos/4cade/AngryCartels/contributors","subscribers_url":"https://api.github.com/repos/4cade/AngryCartels/subscribers","subscription_url":"https://api.github.com/repos/4cade/AngryCartels/subscription","commits_url":"https://api.github.com/repos/4cade/AngryCartels/commits{/sha}","git_commits_url":"https://api.github.com/repos/4cade/AngryCartels/git/commits{/sha}","comments_url":"https://api.github.com/repos/4cade/AngryCartels/comments{/number}","issue_comment_url":"https://api.github.com/repos/4cade/AngryCartels/issues/comments{/number}","contents_url":"https://api.github.com/repos/4cade/AngryCartels/contents/{+path}","compare_url":"https://api.github.com/repos/4cade/AngryCartels/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4cade/AngryCartels/merges","archive_url":"https://api.github.com/repos/4cade/AngryCartels/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4cade/AngryCartels/downloads","issues_url":"https://api.github.com/repos/4cade/AngryCartels/issues{/number}","pulls_url":"https://api.github.com/repos/4cade/AngryCartels/pulls{/number}","milestones_url":"https://api.github.com/repos/4cade/AngryCartels/milestones{/number}","notifications_url":"https://api.github.com/repos/4cade/AngryCartels/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4cade/AngryCartels/labels{/name}","releases_url":"https://api.github.com/repos/4cade/AngryCartels/releases{/id}","deployments_url":"https://api.github.com/repos/4cade/AngryCartels/deployments","created_at":"2015-10-30T05:44:08Z","updated_at":"2016-12-22T13:11:25Z","pushed_at":"2016-12-24T06:23:01Z","git_url":"git://github.com/4cade/AngryCartels.git","ssh_url":"git@github.com:4cade/AngryCartels.git","clone_url":"https://github.com/4cade/AngryCartels.git","svn_url":"https://github.com/4cade/AngryCartels","homepage":"","size":19122,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":5,"default_branch":"master"}},"base":{"label":"4cade:master","ref":"master","sha":"8c1625ba0d24ee292294e0879cce72f029cd33dc","user":{"login":"4cade","id":24379445,"avatar_url":"https://avatars.githubusercontent.com/u/24379445?v=3","gravatar_id":"","url":"https://api.github.com/users/4cade","html_url":"https://github.com/4cade","followers_url":"https://api.github.com/users/4cade/followers","following_url":"https://api.github.com/users/4cade/following{/other_user}","gists_url":"https://api.github.com/users/4cade/gists{/gist_id}","starred_url":"https://api.github.com/users/4cade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4cade/subscriptions","organizations_url":"https://api.github.com/users/4cade/orgs","repos_url":"https://api.github.com/users/4cade/repos","events_url":"https://api.github.com/users/4cade/events{/privacy}","received_events_url":"https://api.github.com/users/4cade/received_events","type":"Organization","site_admin":false},"repo":{"id":45231513,"name":"AngryCartels","full_name":"4cade/AngryCartels","owner":{"login":"4cade","id":24379445,"avatar_url":"https://avatars.githubusercontent.com/u/24379445?v=3","gravatar_id":"","url":"https://api.github.com/users/4cade","html_url":"https://github.com/4cade","followers_url":"https://api.github.com/users/4cade/followers","following_url":"https://api.github.com/users/4cade/following{/other_user}","gists_url":"https://api.github.com/users/4cade/gists{/gist_id}","starred_url":"https://api.github.com/users/4cade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4cade/subscriptions","organizations_url":"https://api.github.com/users/4cade/orgs","repos_url":"https://api.github.com/users/4cade/repos","events_url":"https://api.github.com/users/4cade/events{/privacy}","received_events_url":"https://api.github.com/users/4cade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4cade/AngryCartels","description":"Online Multiplayer Monopoly-like game","fork":false,"url":"https://api.github.com/repos/4cade/AngryCartels","forks_url":"https://api.github.com/repos/4cade/AngryCartels/forks","keys_url":"https://api.github.com/repos/4cade/AngryCartels/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4cade/AngryCartels/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4cade/AngryCartels/teams","hooks_url":"https://api.github.com/repos/4cade/AngryCartels/hooks","issue_events_url":"https://api.github.com/repos/4cade/AngryCartels/issues/events{/number}","events_url":"https://api.github.com/repos/4cade/AngryCartels/events","assignees_url":"https://api.github.com/repos/4cade/AngryCartels/assignees{/user}","branches_url":"https://api.github.com/repos/4cade/AngryCartels/branches{/branch}","tags_url":"https://api.github.com/repos/4cade/AngryCartels/tags","blobs_url":"https://api.github.com/repos/4cade/AngryCartels/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4cade/AngryCartels/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4cade/AngryCartels/git/refs{/sha}","trees_url":"https://api.github.com/repos/4cade/AngryCartels/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4cade/AngryCartels/statuses/{sha}","languages_url":"https://api.github.com/repos/4cade/AngryCartels/languages","stargazers_url":"https://api.github.com/repos/4cade/AngryCartels/stargazers","contributors_url":"https://api.github.com/repos/4cade/AngryCartels/contributors","subscribers_url":"https://api.github.com/repos/4cade/AngryCartels/subscribers","subscription_url":"https://api.github.com/repos/4cade/AngryCartels/subscription","commits_url":"https://api.github.com/repos/4cade/AngryCartels/commits{/sha}","git_commits_url":"https://api.github.com/repos/4cade/AngryCartels/git/commits{/sha}","comments_url":"https://api.github.com/repos/4cade/AngryCartels/comments{/number}","issue_comment_url":"https://api.github.com/repos/4cade/AngryCartels/issues/comments{/number}","contents_url":"https://api.github.com/repos/4cade/AngryCartels/contents/{+path}","compare_url":"https://api.github.com/repos/4cade/AngryCartels/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4cade/AngryCartels/merges","archive_url":"https://api.github.com/repos/4cade/AngryCartels/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4cade/AngryCartels/downloads","issues_url":"https://api.github.com/repos/4cade/AngryCartels/issues{/number}","pulls_url":"https://api.github.com/repos/4cade/AngryCartels/pulls{/number}","milestones_url":"https://api.github.com/repos/4cade/AngryCartels/milestones{/number}","notifications_url":"https://api.github.com/repos/4cade/AngryCartels/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4cade/AngryCartels/labels{/name}","releases_url":"https://api.github.com/repos/4cade/AngryCartels/releases{/id}","deployments_url":"https://api.github.com/repos/4cade/AngryCartels/deployments","created_at":"2015-10-30T05:44:08Z","updated_at":"2016-12-22T13:11:25Z","pushed_at":"2016-12-24T06:23:01Z","git_url":"git://github.com/4cade/AngryCartels.git","ssh_url":"git@github.com:4cade/AngryCartels.git","clone_url":"https://github.com/4cade/AngryCartels.git","svn_url":"https://github.com/4cade/AngryCartels","homepage":"","size":19122,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/4cade/AngryCartels/pulls/3"},"html":{"href":"https://github.com/4cade/AngryCartels/pull/3"},"issue":{"href":"https://api.github.com/repos/4cade/AngryCartels/issues/3"},"comments":{"href":"https://api.github.com/repos/4cade/AngryCartels/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/4cade/AngryCartels/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/4cade/AngryCartels/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/4cade/AngryCartels/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/4cade/AngryCartels/statuses/ed0cec17ed8cc45a2f99c8ad60caf1ef60a11844"}}}}
{"actor":{"display_login":"Se7ensins1"}}