{"action":"created","comment":{"url":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/comments/87626486","pull_request_review_id":8234043,"id":87626486,"diff_hunk":"@@ -4,23 +4,43 @@ import io.aigar.controller.response.Action\n import scala.math.round\n import com.github.jpbetz.subspace.Vector2\n \n-class Player(val id: Int, startPosition: Vector2) {\n+class Player(val id: Int, startPosition: Vector2) extends EntityContainer {\n   var aiState: AIState = new NullState(this)\n   private var currentCellId: Int = 0\n   var cells = List(new Cell(currentCellId, this, startPosition))\n+  var opponents = List[Player]()\n \n   def update(deltaSeconds: Float, grid: Grid, players: List[Player]): Unit = {\n-    if ( cells.isEmpty ) {\n-      currentCellId += 1\n-      cells = List(new Cell(currentCellId, this, grid.randomPosition))\n+    opponents = players.filterNot(_ == this)\n+    cells = handleCollision(cells, opponents).asInstanceOf[List[Cell]]\n+\n+    if (shouldRespawn) {\n+      getRespawnPosition(grid, opponents, Cell.RespawnRetryAttempts) match {\n+        case Some(position) => {currentCellId += 1","path":"game/src/main/scala/io/aigar/game/Player.scala","position":20,"original_position":20,"commit_id":"b403efb2c23815b45486931cea0e389b4073414b","original_commit_id":"b403efb2c23815b45486931cea0e389b4073414b","user":{"login":"DrPandemic","id":3250155,"avatar_url":"https://avatars.githubusercontent.com/u/3250155?v=3","gravatar_id":"","url":"https://api.github.com/users/DrPandemic","html_url":"https://github.com/DrPandemic","followers_url":"https://api.github.com/users/DrPandemic/followers","following_url":"https://api.github.com/users/DrPandemic/following{/other_user}","gists_url":"https://api.github.com/users/DrPandemic/gists{/gist_id}","starred_url":"https://api.github.com/users/DrPandemic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrPandemic/subscriptions","organizations_url":"https://api.github.com/users/DrPandemic/orgs","repos_url":"https://api.github.com/users/DrPandemic/repos","events_url":"https://api.github.com/users/DrPandemic/events{/privacy}","received_events_url":"https://api.github.com/users/DrPandemic/received_events","type":"User","site_admin":false},"body":"Could it be\r\n```scala\r\ncase Some(position) => {\r\n  currentCellId += 1\r\n```","created_at":"2016-11-11T17:35:12Z","updated_at":"2016-11-11T17:42:37Z","html_url":"https://github.com/DrPandemic/aigar.io/pull/298#discussion_r87626486","pull_request_url":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/298","_links":{"self":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/comments/87626486"},"html":{"href":"https://github.com/DrPandemic/aigar.io/pull/298#discussion_r87626486"},"pull_request":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/298"}}},"pull_request":{"url":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/298","id":93366760,"html_url":"https://github.com/DrPandemic/aigar.io/pull/298","diff_url":"https://github.com/DrPandemic/aigar.io/pull/298.diff","patch_url":"https://github.com/DrPandemic/aigar.io/pull/298.patch","issue_url":"https://api.github.com/repos/DrPandemic/aigar.io/issues/298","number":298,"state":"open","locked":false,"title":"Refactor cell","user":{"login":"MicLamb","id":6540007,"avatar_url":"https://avatars.githubusercontent.com/u/6540007?v=3","gravatar_id":"","url":"https://api.github.com/users/MicLamb","html_url":"https://github.com/MicLamb","followers_url":"https://api.github.com/users/MicLamb/followers","following_url":"https://api.github.com/users/MicLamb/following{/other_user}","gists_url":"https://api.github.com/users/MicLamb/gists{/gist_id}","starred_url":"https://api.github.com/users/MicLamb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicLamb/subscriptions","organizations_url":"https://api.github.com/users/MicLamb/orgs","repos_url":"https://api.github.com/users/MicLamb/repos","events_url":"https://api.github.com/users/MicLamb/events{/privacy}","received_events_url":"https://api.github.com/users/MicLamb/received_events","type":"User","site_admin":false},"body":"Small PR.\r\n\r\nRefactored `Cell` a little bit. Removed the `eat` since it is now `onCellCollision`. \r\nAdded the `onCellCollision` and used it in `Virus` and `Cell`. \r\n\r\nRelated to #274 ","created_at":"2016-11-11T17:18:42Z","updated_at":"2016-11-11T17:42:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"128eef393525dce991f985c9b84ba45c2e785cde","assignee":{"login":"MicLamb","id":6540007,"avatar_url":"https://avatars.githubusercontent.com/u/6540007?v=3","gravatar_id":"","url":"https://api.github.com/users/MicLamb","html_url":"https://github.com/MicLamb","followers_url":"https://api.github.com/users/MicLamb/followers","following_url":"https://api.github.com/users/MicLamb/following{/other_user}","gists_url":"https://api.github.com/users/MicLamb/gists{/gist_id}","starred_url":"https://api.github.com/users/MicLamb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicLamb/subscriptions","organizations_url":"https://api.github.com/users/MicLamb/orgs","repos_url":"https://api.github.com/users/MicLamb/repos","events_url":"https://api.github.com/users/MicLamb/events{/privacy}","received_events_url":"https://api.github.com/users/MicLamb/received_events","type":"User","site_admin":false},"assignees":[{"login":"MicLamb","id":6540007,"avatar_url":"https://avatars.githubusercontent.com/u/6540007?v=3","gravatar_id":"","url":"https://api.github.com/users/MicLamb","html_url":"https://github.com/MicLamb","followers_url":"https://api.github.com/users/MicLamb/followers","following_url":"https://api.github.com/users/MicLamb/following{/other_user}","gists_url":"https://api.github.com/users/MicLamb/gists{/gist_id}","starred_url":"https://api.github.com/users/MicLamb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicLamb/subscriptions","organizations_url":"https://api.github.com/users/MicLamb/orgs","repos_url":"https://api.github.com/users/MicLamb/repos","events_url":"https://api.github.com/users/MicLamb/events{/privacy}","received_events_url":"https://api.github.com/users/MicLamb/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/298/commits","review_comments_url":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/298/comments","review_comment_url":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DrPandemic/aigar.io/issues/298/comments","statuses_url":"https://api.github.com/repos/DrPandemic/aigar.io/statuses/b403efb2c23815b45486931cea0e389b4073414b","head":{"label":"DrPandemic:refactor-cell","ref":"refactor-cell","sha":"b403efb2c23815b45486931cea0e389b4073414b","user":{"login":"DrPandemic","id":3250155,"avatar_url":"https://avatars.githubusercontent.com/u/3250155?v=3","gravatar_id":"","url":"https://api.github.com/users/DrPandemic","html_url":"https://github.com/DrPandemic","followers_url":"https://api.github.com/users/DrPandemic/followers","following_url":"https://api.github.com/users/DrPandemic/following{/other_user}","gists_url":"https://api.github.com/users/DrPandemic/gists{/gist_id}","starred_url":"https://api.github.com/users/DrPandemic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrPandemic/subscriptions","organizations_url":"https://api.github.com/users/DrPandemic/orgs","repos_url":"https://api.github.com/users/DrPandemic/repos","events_url":"https://api.github.com/users/DrPandemic/events{/privacy}","received_events_url":"https://api.github.com/users/DrPandemic/received_events","type":"User","site_admin":false},"repo":{"id":68840511,"name":"aigar.io","full_name":"DrPandemic/aigar.io","owner":{"login":"DrPandemic","id":3250155,"avatar_url":"https://avatars.githubusercontent.com/u/3250155?v=3","gravatar_id":"","url":"https://api.github.com/users/DrPandemic","html_url":"https://github.com/DrPandemic","followers_url":"https://api.github.com/users/DrPandemic/followers","following_url":"https://api.github.com/users/DrPandemic/following{/other_user}","gists_url":"https://api.github.com/users/DrPandemic/gists{/gist_id}","starred_url":"https://api.github.com/users/DrPandemic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrPandemic/subscriptions","organizations_url":"https://api.github.com/users/DrPandemic/orgs","repos_url":"https://api.github.com/users/DrPandemic/repos","events_url":"https://api.github.com/users/DrPandemic/events{/privacy}","received_events_url":"https://api.github.com/users/DrPandemic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DrPandemic/aigar.io","description":null,"fork":false,"url":"https://api.github.com/repos/DrPandemic/aigar.io","forks_url":"https://api.github.com/repos/DrPandemic/aigar.io/forks","keys_url":"https://api.github.com/repos/DrPandemic/aigar.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DrPandemic/aigar.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DrPandemic/aigar.io/teams","hooks_url":"https://api.github.com/repos/DrPandemic/aigar.io/hooks","issue_events_url":"https://api.github.com/repos/DrPandemic/aigar.io/issues/events{/number}","events_url":"https://api.github.com/repos/DrPandemic/aigar.io/events","assignees_url":"https://api.github.com/repos/DrPandemic/aigar.io/assignees{/user}","branches_url":"https://api.github.com/repos/DrPandemic/aigar.io/branches{/branch}","tags_url":"https://api.github.com/repos/DrPandemic/aigar.io/tags","blobs_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DrPandemic/aigar.io/statuses/{sha}","languages_url":"https://api.github.com/repos/DrPandemic/aigar.io/languages","stargazers_url":"https://api.github.com/repos/DrPandemic/aigar.io/stargazers","contributors_url":"https://api.github.com/repos/DrPandemic/aigar.io/contributors","subscribers_url":"https://api.github.com/repos/DrPandemic/aigar.io/subscribers","subscription_url":"https://api.github.com/repos/DrPandemic/aigar.io/subscription","commits_url":"https://api.github.com/repos/DrPandemic/aigar.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/DrPandemic/aigar.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/DrPandemic/aigar.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/DrPandemic/aigar.io/contents/{+path}","compare_url":"https://api.github.com/repos/DrPandemic/aigar.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DrPandemic/aigar.io/merges","archive_url":"https://api.github.com/repos/DrPandemic/aigar.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DrPandemic/aigar.io/downloads","issues_url":"https://api.github.com/repos/DrPandemic/aigar.io/issues{/number}","pulls_url":"https://api.github.com/repos/DrPandemic/aigar.io/pulls{/number}","milestones_url":"https://api.github.com/repos/DrPandemic/aigar.io/milestones{/number}","notifications_url":"https://api.github.com/repos/DrPandemic/aigar.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DrPandemic/aigar.io/labels{/name}","releases_url":"https://api.github.com/repos/DrPandemic/aigar.io/releases{/id}","deployments_url":"https://api.github.com/repos/DrPandemic/aigar.io/deployments","created_at":"2016-09-21T17:18:41Z","updated_at":"2016-11-01T23:23:51Z","pushed_at":"2016-11-11T17:23:44Z","git_url":"git://github.com/DrPandemic/aigar.io.git","ssh_url":"git@github.com:DrPandemic/aigar.io.git","clone_url":"https://github.com/DrPandemic/aigar.io.git","svn_url":"https://github.com/DrPandemic/aigar.io","homepage":null,"size":3161,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":40,"forks":0,"open_issues":40,"watchers":3,"default_branch":"master"}},"base":{"label":"DrPandemic:master","ref":"master","sha":"8d2561356a852d91c4d842955758e3c574df5023","user":{"login":"DrPandemic","id":3250155,"avatar_url":"https://avatars.githubusercontent.com/u/3250155?v=3","gravatar_id":"","url":"https://api.github.com/users/DrPandemic","html_url":"https://github.com/DrPandemic","followers_url":"https://api.github.com/users/DrPandemic/followers","following_url":"https://api.github.com/users/DrPandemic/following{/other_user}","gists_url":"https://api.github.com/users/DrPandemic/gists{/gist_id}","starred_url":"https://api.github.com/users/DrPandemic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrPandemic/subscriptions","organizations_url":"https://api.github.com/users/DrPandemic/orgs","repos_url":"https://api.github.com/users/DrPandemic/repos","events_url":"https://api.github.com/users/DrPandemic/events{/privacy}","received_events_url":"https://api.github.com/users/DrPandemic/received_events","type":"User","site_admin":false},"repo":{"id":68840511,"name":"aigar.io","full_name":"DrPandemic/aigar.io","owner":{"login":"DrPandemic","id":3250155,"avatar_url":"https://avatars.githubusercontent.com/u/3250155?v=3","gravatar_id":"","url":"https://api.github.com/users/DrPandemic","html_url":"https://github.com/DrPandemic","followers_url":"https://api.github.com/users/DrPandemic/followers","following_url":"https://api.github.com/users/DrPandemic/following{/other_user}","gists_url":"https://api.github.com/users/DrPandemic/gists{/gist_id}","starred_url":"https://api.github.com/users/DrPandemic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrPandemic/subscriptions","organizations_url":"https://api.github.com/users/DrPandemic/orgs","repos_url":"https://api.github.com/users/DrPandemic/repos","events_url":"https://api.github.com/users/DrPandemic/events{/privacy}","received_events_url":"https://api.github.com/users/DrPandemic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DrPandemic/aigar.io","description":null,"fork":false,"url":"https://api.github.com/repos/DrPandemic/aigar.io","forks_url":"https://api.github.com/repos/DrPandemic/aigar.io/forks","keys_url":"https://api.github.com/repos/DrPandemic/aigar.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DrPandemic/aigar.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DrPandemic/aigar.io/teams","hooks_url":"https://api.github.com/repos/DrPandemic/aigar.io/hooks","issue_events_url":"https://api.github.com/repos/DrPandemic/aigar.io/issues/events{/number}","events_url":"https://api.github.com/repos/DrPandemic/aigar.io/events","assignees_url":"https://api.github.com/repos/DrPandemic/aigar.io/assignees{/user}","branches_url":"https://api.github.com/repos/DrPandemic/aigar.io/branches{/branch}","tags_url":"https://api.github.com/repos/DrPandemic/aigar.io/tags","blobs_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DrPandemic/aigar.io/statuses/{sha}","languages_url":"https://api.github.com/repos/DrPandemic/aigar.io/languages","stargazers_url":"https://api.github.com/repos/DrPandemic/aigar.io/stargazers","contributors_url":"https://api.github.com/repos/DrPandemic/aigar.io/contributors","subscribers_url":"https://api.github.com/repos/DrPandemic/aigar.io/subscribers","subscription_url":"https://api.github.com/repos/DrPandemic/aigar.io/subscription","commits_url":"https://api.github.com/repos/DrPandemic/aigar.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/DrPandemic/aigar.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/DrPandemic/aigar.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/DrPandemic/aigar.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/DrPandemic/aigar.io/contents/{+path}","compare_url":"https://api.github.com/repos/DrPandemic/aigar.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DrPandemic/aigar.io/merges","archive_url":"https://api.github.com/repos/DrPandemic/aigar.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DrPandemic/aigar.io/downloads","issues_url":"https://api.github.com/repos/DrPandemic/aigar.io/issues{/number}","pulls_url":"https://api.github.com/repos/DrPandemic/aigar.io/pulls{/number}","milestones_url":"https://api.github.com/repos/DrPandemic/aigar.io/milestones{/number}","notifications_url":"https://api.github.com/repos/DrPandemic/aigar.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DrPandemic/aigar.io/labels{/name}","releases_url":"https://api.github.com/repos/DrPandemic/aigar.io/releases{/id}","deployments_url":"https://api.github.com/repos/DrPandemic/aigar.io/deployments","created_at":"2016-09-21T17:18:41Z","updated_at":"2016-11-01T23:23:51Z","pushed_at":"2016-11-11T17:23:44Z","git_url":"git://github.com/DrPandemic/aigar.io.git","ssh_url":"git@github.com:DrPandemic/aigar.io.git","clone_url":"https://github.com/DrPandemic/aigar.io.git","svn_url":"https://github.com/DrPandemic/aigar.io","homepage":null,"size":3161,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":40,"forks":0,"open_issues":40,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/298"},"html":{"href":"https://github.com/DrPandemic/aigar.io/pull/298"},"issue":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/issues/298"},"comments":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/issues/298/comments"},"review_comments":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/298/comments"},"review_comment":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/pulls/298/commits"},"statuses":{"href":"https://api.github.com/repos/DrPandemic/aigar.io/statuses/b403efb2c23815b45486931cea0e389b4073414b"}}}}
{"actor":{"display_login":"DrPandemic"}}