{"action":"created","comment":{"url":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/comments/59109654","id":59109654,"diff_hunk":"@@ -119,11 +127,52 @@ var Character = function(realName, gameName, level, gameClass, race) {\n     this.characterLevel = level;\n     this.characterClass = gameClass;\n     this.characterRace = race;\n+    this.inventory = [];\n+    this.money = { \"Copper Pieces\"      : 0,\n+                   \"Silver Pieces\"      : 0,\n+                   \"Gold Pieces\"        : 0,\n+                   \"Platinum Pieces\"    : 0,\n+                   \"Electrum Pieces\"    : 0};\n };\n \n Character.prototype = Object.create(Player.prototype);\n Character.prototype.constructor = Character;\n \n+Character.prototype.addItem = function(newItem) {\n+    for (var item in this.inventory) {\n+        if (this.inventory[item].name === newItem.name) {\n+            this.inventory[item].quantity += newItem.quantity;\n+            return \"Added new quantity to existing quantity.\";\n+        }\n+    }\n+\n+    this.inventory.push(newItem);\n+    return \"Added new item to inventory\";\n+}\n+\n+Character.prototype.removeItem = function(targetItem) {\n+    for (var item in this.inventory) {\n+        if (this.inventory[item].name === targetItem.name) {\n+            this.inventory[item].quantity -= targetItem.quantity;\n+            if (this.inventory[item].quantity === 0) {\n+                this.inventory.splice(item, 1);\n+            }\n+            return \"Removed quantity from existing quantity.\";\n+        }\n+    }\n+\n+    return \"Item not found in inventory\";\n+}\n+\n+Character.prototype.listInventory = function() {\n+    for (var item in this.inventory) {\n+        console.log(this.inventory[item].name + \", \" + ","path":"handleData.js","position":74,"original_position":74,"commit_id":"76d8c653b783b1de93a0f04c6a5da58d63f14c7d","original_commit_id":"76d8c653b783b1de93a0f04c6a5da58d63f14c7d","user":{"login":"zmbush","id":1189378,"avatar_url":"https://avatars.githubusercontent.com/u/1189378?v=3","gravatar_id":"","url":"https://api.github.com/users/zmbush","html_url":"https://github.com/zmbush","followers_url":"https://api.github.com/users/zmbush/followers","following_url":"https://api.github.com/users/zmbush/following{/other_user}","gists_url":"https://api.github.com/users/zmbush/gists{/gist_id}","starred_url":"https://api.github.com/users/zmbush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmbush/subscriptions","organizations_url":"https://api.github.com/users/zmbush/orgs","repos_url":"https://api.github.com/users/zmbush/repos","events_url":"https://api.github.com/users/zmbush/events{/privacy}","received_events_url":"https://api.github.com/users/zmbush/received_events","type":"User","site_admin":false},"body":"Also, this seems like something that should be in the item class.\r\n\r\nthat would make this line: `this.inventory[item].print()` or something like that.","created_at":"2016-04-09T03:36:12Z","updated_at":"2016-04-09T03:36:12Z","html_url":"https://github.com/nrebhun/AdventureAssistant/pull/1#discussion_r59109654","pull_request_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/comments/59109654"},"html":{"href":"https://github.com/nrebhun/AdventureAssistant/pull/1#discussion_r59109654"},"pull_request":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/1","id":65829532,"html_url":"https://github.com/nrebhun/AdventureAssistant/pull/1","diff_url":"https://github.com/nrebhun/AdventureAssistant/pull/1.diff","patch_url":"https://github.com/nrebhun/AdventureAssistant/pull/1.patch","issue_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues/1","number":1,"state":"open","locked":false,"title":"Merge of feat/items to master","user":{"login":"nrebhun","id":2058067,"avatar_url":"https://avatars.githubusercontent.com/u/2058067?v=3","gravatar_id":"","url":"https://api.github.com/users/nrebhun","html_url":"https://github.com/nrebhun","followers_url":"https://api.github.com/users/nrebhun/followers","following_url":"https://api.github.com/users/nrebhun/following{/other_user}","gists_url":"https://api.github.com/users/nrebhun/gists{/gist_id}","starred_url":"https://api.github.com/users/nrebhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrebhun/subscriptions","organizations_url":"https://api.github.com/users/nrebhun/orgs","repos_url":"https://api.github.com/users/nrebhun/repos","events_url":"https://api.github.com/users/nrebhun/events{/privacy}","received_events_url":"https://api.github.com/users/nrebhun/received_events","type":"User","site_admin":false},"body":"Basic item/inventory functionality is working. Items can be added and removed, and quantities of items are appropriately tracked.","created_at":"2016-04-08T18:43:19Z","updated_at":"2016-04-09T03:36:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f724250c54ba395cbf8c9685954dce8eb7c23b5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/1/commits","review_comments_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/1/comments","review_comment_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues/1/comments","statuses_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/statuses/76d8c653b783b1de93a0f04c6a5da58d63f14c7d","head":{"label":"nrebhun:feat/items","ref":"feat/items","sha":"76d8c653b783b1de93a0f04c6a5da58d63f14c7d","user":{"login":"nrebhun","id":2058067,"avatar_url":"https://avatars.githubusercontent.com/u/2058067?v=3","gravatar_id":"","url":"https://api.github.com/users/nrebhun","html_url":"https://github.com/nrebhun","followers_url":"https://api.github.com/users/nrebhun/followers","following_url":"https://api.github.com/users/nrebhun/following{/other_user}","gists_url":"https://api.github.com/users/nrebhun/gists{/gist_id}","starred_url":"https://api.github.com/users/nrebhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrebhun/subscriptions","organizations_url":"https://api.github.com/users/nrebhun/orgs","repos_url":"https://api.github.com/users/nrebhun/repos","events_url":"https://api.github.com/users/nrebhun/events{/privacy}","received_events_url":"https://api.github.com/users/nrebhun/received_events","type":"User","site_admin":false},"repo":{"id":50323799,"name":"AdventureAssistant","full_name":"nrebhun/AdventureAssistant","owner":{"login":"nrebhun","id":2058067,"avatar_url":"https://avatars.githubusercontent.com/u/2058067?v=3","gravatar_id":"","url":"https://api.github.com/users/nrebhun","html_url":"https://github.com/nrebhun","followers_url":"https://api.github.com/users/nrebhun/followers","following_url":"https://api.github.com/users/nrebhun/following{/other_user}","gists_url":"https://api.github.com/users/nrebhun/gists{/gist_id}","starred_url":"https://api.github.com/users/nrebhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrebhun/subscriptions","organizations_url":"https://api.github.com/users/nrebhun/orgs","repos_url":"https://api.github.com/users/nrebhun/repos","events_url":"https://api.github.com/users/nrebhun/events{/privacy}","received_events_url":"https://api.github.com/users/nrebhun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nrebhun/AdventureAssistant","description":"","fork":false,"url":"https://api.github.com/repos/nrebhun/AdventureAssistant","forks_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/forks","keys_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/teams","hooks_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/hooks","issue_events_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues/events{/number}","events_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/events","assignees_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/assignees{/user}","branches_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/branches{/branch}","tags_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/tags","blobs_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/statuses/{sha}","languages_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/languages","stargazers_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/stargazers","contributors_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/contributors","subscribers_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/subscribers","subscription_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/subscription","commits_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/contents/{+path}","compare_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/merges","archive_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/downloads","issues_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues{/number}","pulls_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls{/number}","milestones_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/milestones{/number}","notifications_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/labels{/name}","releases_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/releases{/id}","deployments_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/deployments","created_at":"2016-01-25T03:34:24Z","updated_at":"2016-02-24T22:20:21Z","pushed_at":"2016-04-08T19:00:28Z","git_url":"git://github.com/nrebhun/AdventureAssistant.git","ssh_url":"git@github.com:nrebhun/AdventureAssistant.git","clone_url":"https://github.com/nrebhun/AdventureAssistant.git","svn_url":"https://github.com/nrebhun/AdventureAssistant","homepage":null,"size":226,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"nrebhun:master","ref":"master","sha":"52967edbb628b5f8d1ce2849f4e3dc8b7d2d3d74","user":{"login":"nrebhun","id":2058067,"avatar_url":"https://avatars.githubusercontent.com/u/2058067?v=3","gravatar_id":"","url":"https://api.github.com/users/nrebhun","html_url":"https://github.com/nrebhun","followers_url":"https://api.github.com/users/nrebhun/followers","following_url":"https://api.github.com/users/nrebhun/following{/other_user}","gists_url":"https://api.github.com/users/nrebhun/gists{/gist_id}","starred_url":"https://api.github.com/users/nrebhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrebhun/subscriptions","organizations_url":"https://api.github.com/users/nrebhun/orgs","repos_url":"https://api.github.com/users/nrebhun/repos","events_url":"https://api.github.com/users/nrebhun/events{/privacy}","received_events_url":"https://api.github.com/users/nrebhun/received_events","type":"User","site_admin":false},"repo":{"id":50323799,"name":"AdventureAssistant","full_name":"nrebhun/AdventureAssistant","owner":{"login":"nrebhun","id":2058067,"avatar_url":"https://avatars.githubusercontent.com/u/2058067?v=3","gravatar_id":"","url":"https://api.github.com/users/nrebhun","html_url":"https://github.com/nrebhun","followers_url":"https://api.github.com/users/nrebhun/followers","following_url":"https://api.github.com/users/nrebhun/following{/other_user}","gists_url":"https://api.github.com/users/nrebhun/gists{/gist_id}","starred_url":"https://api.github.com/users/nrebhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrebhun/subscriptions","organizations_url":"https://api.github.com/users/nrebhun/orgs","repos_url":"https://api.github.com/users/nrebhun/repos","events_url":"https://api.github.com/users/nrebhun/events{/privacy}","received_events_url":"https://api.github.com/users/nrebhun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nrebhun/AdventureAssistant","description":"","fork":false,"url":"https://api.github.com/repos/nrebhun/AdventureAssistant","forks_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/forks","keys_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/teams","hooks_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/hooks","issue_events_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues/events{/number}","events_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/events","assignees_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/assignees{/user}","branches_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/branches{/branch}","tags_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/tags","blobs_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/statuses/{sha}","languages_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/languages","stargazers_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/stargazers","contributors_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/contributors","subscribers_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/subscribers","subscription_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/subscription","commits_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/contents/{+path}","compare_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/merges","archive_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/downloads","issues_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues{/number}","pulls_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls{/number}","milestones_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/milestones{/number}","notifications_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/labels{/name}","releases_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/releases{/id}","deployments_url":"https://api.github.com/repos/nrebhun/AdventureAssistant/deployments","created_at":"2016-01-25T03:34:24Z","updated_at":"2016-02-24T22:20:21Z","pushed_at":"2016-04-08T19:00:28Z","git_url":"git://github.com/nrebhun/AdventureAssistant.git","ssh_url":"git@github.com:nrebhun/AdventureAssistant.git","clone_url":"https://github.com/nrebhun/AdventureAssistant.git","svn_url":"https://github.com/nrebhun/AdventureAssistant","homepage":null,"size":226,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/1"},"html":{"href":"https://github.com/nrebhun/AdventureAssistant/pull/1"},"issue":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues/1"},"comments":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/nrebhun/AdventureAssistant/statuses/76d8c653b783b1de93a0f04c6a5da58d63f14c7d"}}}}