{"action":"created","comment":{"url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/comments/128906910","pull_request_review_id":51632417,"id":128906910,"diff_hunk":"@@ -72,17 +78,78 @@ function roundWinner(instance) {\n   }\n };\n \n+//Awards points to the winner of the round. Takes roundWinner as an argument.\n function awardPoints(instance, id) {\n \n   if (id) {\n     instance[id].points += instance.prizePool[0];\n     instance.prizePool.splice(0, 1);\n+    reset(instance);\n   } else {\n     let message = \"Round nulled, two or more players played same card.\"\n     instance.prizePool.splice(0, 1);\n+    reset(instance);\n+    return message;\n   }\n }\n \n+//Once winner has been decided, resets hand of each player to zero.\n+function reset(instance) {\n+\n+  for (let player in instance) {\n+    if(instance[player].readyCard !== undefined){\n+      instance[player].readyCard = 0\n+    }\n+  }\n+};\n+\n+//At the begginning of every round, will check to see if every player has played. Status conditional -- needs to run\n+//before checking a winner.\n+function readyCheck(instance) {\n+\n+  let ready = true;\n+  for (let player in instance) {\n+    if(instance[player].readyCard === 0) {\n+      ready = false;\n+    }\n+  }\n+  return ready;\n+}\n+\n+//Cheecks to see if the game is still playable based on the number of cards in the prize pool. At zero, returns false.\n+function gameCheck(instance){\n+\n+  let status = true;\n+  if (instance.prizePool.length === 0) {\n+    status = false\n+  }\n+  return status;\n+}\n+\n+//Will run after having checked if game is done. If it is, will dfind the player with the highest points and return that.\n+function endGame (instance) {\n+\n+  let gameWinner = 0;\n+  let totalPoints = 0;\n+\n+  for (let player in instance) {\n+    if ((instance[player].points) > totalPoints){\n+      totalPoints = instance[player].points;\n+      gameWinner = player;\n+    }\n+  }\n+  return gameWinner;\n+}\n+\n+// Will run after a player has joined the round. Returns true if the maximum number of players ahave been reached.\n+function startCheck(instance) {\n+  status = false;\n+  if (instance.playerCount === instance.maxPlayers){","path":"games/gopsHelpers.js","position":124,"original_position":124,"commit_id":"f8642048d8b49123204e2777cdd1973f3a893c8c","original_commit_id":"f8642048d8b49123204e2777cdd1973f3a893c8c","user":{"login":"DerangedMind","id":1727164,"avatar_url":"https://avatars0.githubusercontent.com/u/1727164?v=4","gravatar_id":"","url":"https://api.github.com/users/DerangedMind","html_url":"https://github.com/DerangedMind","followers_url":"https://api.github.com/users/DerangedMind/followers","following_url":"https://api.github.com/users/DerangedMind/following{/other_user}","gists_url":"https://api.github.com/users/DerangedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/DerangedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DerangedMind/subscriptions","organizations_url":"https://api.github.com/users/DerangedMind/orgs","repos_url":"https://api.github.com/users/DerangedMind/repos","events_url":"https://api.github.com/users/DerangedMind/events{/privacy}","received_events_url":"https://api.github.com/users/DerangedMind/received_events","type":"User","site_admin":false},"body":"maxPlayers or autostartPlayers?","created_at":"2017-07-22T23:15:08Z","updated_at":"2017-07-22T23:54:28Z","html_url":"https://github.com/DerangedMind/reimagined-octo-adventure/pull/4#discussion_r128906910","pull_request_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/comments/128906910"},"html":{"href":"https://github.com/DerangedMind/reimagined-octo-adventure/pull/4#discussion_r128906910"},"pull_request":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/4","id":131915089,"html_url":"https://github.com/DerangedMind/reimagined-octo-adventure/pull/4","diff_url":"https://github.com/DerangedMind/reimagined-octo-adventure/pull/4.diff","patch_url":"https://github.com/DerangedMind/reimagined-octo-adventure/pull/4.patch","issue_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues/4","number":4,"state":"open","locked":false,"title":"Feature/gops","user":{"login":"Garo-A","id":28066633,"avatar_url":"https://avatars3.githubusercontent.com/u/28066633?v=4","gravatar_id":"","url":"https://api.github.com/users/Garo-A","html_url":"https://github.com/Garo-A","followers_url":"https://api.github.com/users/Garo-A/followers","following_url":"https://api.github.com/users/Garo-A/following{/other_user}","gists_url":"https://api.github.com/users/Garo-A/gists{/gist_id}","starred_url":"https://api.github.com/users/Garo-A/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Garo-A/subscriptions","organizations_url":"https://api.github.com/users/Garo-A/orgs","repos_url":"https://api.github.com/users/Garo-A/repos","events_url":"https://api.github.com/users/Garo-A/events{/privacy}","received_events_url":"https://api.github.com/users/Garo-A/received_events","type":"User","site_admin":false},"body":"All functions for game logic","created_at":"2017-07-22T22:38:30Z","updated_at":"2017-07-22T23:54:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/4/commits","review_comments_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/4/comments","review_comment_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues/4/comments","statuses_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/statuses/f8642048d8b49123204e2777cdd1973f3a893c8c","head":{"label":"DerangedMind:feature/gops","ref":"feature/gops","sha":"f8642048d8b49123204e2777cdd1973f3a893c8c","user":{"login":"DerangedMind","id":1727164,"avatar_url":"https://avatars0.githubusercontent.com/u/1727164?v=4","gravatar_id":"","url":"https://api.github.com/users/DerangedMind","html_url":"https://github.com/DerangedMind","followers_url":"https://api.github.com/users/DerangedMind/followers","following_url":"https://api.github.com/users/DerangedMind/following{/other_user}","gists_url":"https://api.github.com/users/DerangedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/DerangedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DerangedMind/subscriptions","organizations_url":"https://api.github.com/users/DerangedMind/orgs","repos_url":"https://api.github.com/users/DerangedMind/repos","events_url":"https://api.github.com/users/DerangedMind/events{/privacy}","received_events_url":"https://api.github.com/users/DerangedMind/received_events","type":"User","site_admin":false},"repo":{"id":97756713,"name":"reimagined-octo-adventure","full_name":"DerangedMind/reimagined-octo-adventure","owner":{"login":"DerangedMind","id":1727164,"avatar_url":"https://avatars0.githubusercontent.com/u/1727164?v=4","gravatar_id":"","url":"https://api.github.com/users/DerangedMind","html_url":"https://github.com/DerangedMind","followers_url":"https://api.github.com/users/DerangedMind/followers","following_url":"https://api.github.com/users/DerangedMind/following{/other_user}","gists_url":"https://api.github.com/users/DerangedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/DerangedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DerangedMind/subscriptions","organizations_url":"https://api.github.com/users/DerangedMind/orgs","repos_url":"https://api.github.com/users/DerangedMind/repos","events_url":"https://api.github.com/users/DerangedMind/events{/privacy}","received_events_url":"https://api.github.com/users/DerangedMind/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DerangedMind/reimagined-octo-adventure","description":"Multiplayer card game app for LHL mid-term project","fork":false,"url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure","forks_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/forks","keys_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/teams","hooks_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/hooks","issue_events_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues/events{/number}","events_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/events","assignees_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/assignees{/user}","branches_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/branches{/branch}","tags_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/tags","blobs_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/refs{/sha}","trees_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/statuses/{sha}","languages_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/languages","stargazers_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/stargazers","contributors_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/contributors","subscribers_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/subscribers","subscription_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/subscription","commits_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/commits{/sha}","git_commits_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/commits{/sha}","comments_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/comments{/number}","issue_comment_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues/comments{/number}","contents_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/contents/{+path}","compare_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/merges","archive_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/downloads","issues_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues{/number}","pulls_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls{/number}","milestones_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/milestones{/number}","notifications_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/labels{/name}","releases_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/releases{/id}","deployments_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/deployments","created_at":"2017-07-19T20:07:54Z","updated_at":"2017-07-22T15:34:40Z","pushed_at":"2017-07-22T23:01:14Z","git_url":"git://github.com/DerangedMind/reimagined-octo-adventure.git","ssh_url":"git@github.com:DerangedMind/reimagined-octo-adventure.git","clone_url":"https://github.com/DerangedMind/reimagined-octo-adventure.git","svn_url":"https://github.com/DerangedMind/reimagined-octo-adventure","homepage":null,"size":301,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"DerangedMind:master","ref":"master","sha":"313a356ae289d5205d4dc56d9d4ae90d559d2525","user":{"login":"DerangedMind","id":1727164,"avatar_url":"https://avatars0.githubusercontent.com/u/1727164?v=4","gravatar_id":"","url":"https://api.github.com/users/DerangedMind","html_url":"https://github.com/DerangedMind","followers_url":"https://api.github.com/users/DerangedMind/followers","following_url":"https://api.github.com/users/DerangedMind/following{/other_user}","gists_url":"https://api.github.com/users/DerangedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/DerangedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DerangedMind/subscriptions","organizations_url":"https://api.github.com/users/DerangedMind/orgs","repos_url":"https://api.github.com/users/DerangedMind/repos","events_url":"https://api.github.com/users/DerangedMind/events{/privacy}","received_events_url":"https://api.github.com/users/DerangedMind/received_events","type":"User","site_admin":false},"repo":{"id":97756713,"name":"reimagined-octo-adventure","full_name":"DerangedMind/reimagined-octo-adventure","owner":{"login":"DerangedMind","id":1727164,"avatar_url":"https://avatars0.githubusercontent.com/u/1727164?v=4","gravatar_id":"","url":"https://api.github.com/users/DerangedMind","html_url":"https://github.com/DerangedMind","followers_url":"https://api.github.com/users/DerangedMind/followers","following_url":"https://api.github.com/users/DerangedMind/following{/other_user}","gists_url":"https://api.github.com/users/DerangedMind/gists{/gist_id}","starred_url":"https://api.github.com/users/DerangedMind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DerangedMind/subscriptions","organizations_url":"https://api.github.com/users/DerangedMind/orgs","repos_url":"https://api.github.com/users/DerangedMind/repos","events_url":"https://api.github.com/users/DerangedMind/events{/privacy}","received_events_url":"https://api.github.com/users/DerangedMind/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DerangedMind/reimagined-octo-adventure","description":"Multiplayer card game app for LHL mid-term project","fork":false,"url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure","forks_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/forks","keys_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/teams","hooks_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/hooks","issue_events_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues/events{/number}","events_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/events","assignees_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/assignees{/user}","branches_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/branches{/branch}","tags_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/tags","blobs_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/refs{/sha}","trees_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/statuses/{sha}","languages_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/languages","stargazers_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/stargazers","contributors_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/contributors","subscribers_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/subscribers","subscription_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/subscription","commits_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/commits{/sha}","git_commits_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/git/commits{/sha}","comments_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/comments{/number}","issue_comment_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues/comments{/number}","contents_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/contents/{+path}","compare_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/merges","archive_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/downloads","issues_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues{/number}","pulls_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls{/number}","milestones_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/milestones{/number}","notifications_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/labels{/name}","releases_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/releases{/id}","deployments_url":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/deployments","created_at":"2017-07-19T20:07:54Z","updated_at":"2017-07-22T15:34:40Z","pushed_at":"2017-07-22T23:01:14Z","git_url":"git://github.com/DerangedMind/reimagined-octo-adventure.git","ssh_url":"git@github.com:DerangedMind/reimagined-octo-adventure.git","clone_url":"https://github.com/DerangedMind/reimagined-octo-adventure.git","svn_url":"https://github.com/DerangedMind/reimagined-octo-adventure","homepage":null,"size":301,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/4"},"html":{"href":"https://github.com/DerangedMind/reimagined-octo-adventure/pull/4"},"issue":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues/4"},"comments":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/DerangedMind/reimagined-octo-adventure/statuses/f8642048d8b49123204e2777cdd1973f3a893c8c"}}}}
{"actor":{"display_login":"DerangedMind"}}