{"action":"created","comment":{"url":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/comments/73131736","id":73131736,"diff_hunk":"@@ -80,13 +84,18 @@ def run_concurrent_turn(self):\n         [thread.join() for thread in threads]\n \n         cells_to_clear = set()\n-        with game_state_provider as game_state:\n-            while not action_queue.empty():\n-                action = action_queue.get()[1]\n-                action.apply(game_state.world_map)\n-                cells_to_clear.add(action.target_location)\n \n-            for cell in cells_to_clear:\n+        while not action_queue.empty():\n+            action = action_queue.get()[1]\n+            with game_state_provider as game_state:\n+                if action.is_legal(game_state.world_map):\n+                    action.apply(game_state.world_map)\n+                else:\n+                    action.reject()\n+            cells_to_clear.add(action.target_location)\n+\n+        for cell in cells_to_clear:\n+            with game_state_provider as game_state:\n                 game_state.world_map.clear_cell_actions(cell)","path":"aimmo-game/simulation/turn_manager.py","position":null,"original_position":51,"commit_id":"f6b0fb88e3bb73bb947a81aa79c959f633428d04","original_commit_id":"f6b0fb88e3bb73bb947a81aa79c959f633428d04","user":{"login":"PhydeauxLeChien","id":7308018,"avatar_url":"https://avatars.githubusercontent.com/u/7308018?v=3","gravatar_id":"","url":"https://api.github.com/users/PhydeauxLeChien","html_url":"https://github.com/PhydeauxLeChien","followers_url":"https://api.github.com/users/PhydeauxLeChien/followers","following_url":"https://api.github.com/users/PhydeauxLeChien/following{/other_user}","gists_url":"https://api.github.com/users/PhydeauxLeChien/gists{/gist_id}","starred_url":"https://api.github.com/users/PhydeauxLeChien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhydeauxLeChien/subscriptions","organizations_url":"https://api.github.com/users/PhydeauxLeChien/orgs","repos_url":"https://api.github.com/users/PhydeauxLeChien/repos","events_url":"https://api.github.com/users/PhydeauxLeChien/events{/privacy}","received_events_url":"https://api.github.com/users/PhydeauxLeChien/received_events","type":"User","site_admin":false},"body":"all events cleared here will already either have been applied or rejected.","created_at":"2016-08-02T10:34:00Z","updated_at":"2016-08-02T10:34:00Z","html_url":"https://github.com/ocadotechnology/aimmo/pull/127#discussion_r73131736","pull_request_url":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/comments/73131736"},"html":{"href":"https://github.com/ocadotechnology/aimmo/pull/127#discussion_r73131736"},"pull_request":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/127","id":79240453,"html_url":"https://github.com/ocadotechnology/aimmo/pull/127","diff_url":"https://github.com/ocadotechnology/aimmo/pull/127.diff","patch_url":"https://github.com/ocadotechnology/aimmo/pull/127.patch","issue_url":"https://api.github.com/repos/ocadotechnology/aimmo/issues/127","number":127,"state":"open","locked":false,"title":"Concurrent turns","user":{"login":"PhydeauxLeChien","id":7308018,"avatar_url":"https://avatars.githubusercontent.com/u/7308018?v=3","gravatar_id":"","url":"https://api.github.com/users/PhydeauxLeChien","html_url":"https://github.com/PhydeauxLeChien","followers_url":"https://api.github.com/users/PhydeauxLeChien/followers","following_url":"https://api.github.com/users/PhydeauxLeChien/following{/other_user}","gists_url":"https://api.github.com/users/PhydeauxLeChien/gists{/gist_id}","starred_url":"https://api.github.com/users/PhydeauxLeChien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhydeauxLeChien/subscriptions","organizations_url":"https://api.github.com/users/PhydeauxLeChien/orgs","repos_url":"https://api.github.com/users/PhydeauxLeChien/repos","events_url":"https://api.github.com/users/PhydeauxLeChien/events{/privacy}","received_events_url":"https://api.github.com/users/PhydeauxLeChien/received_events","type":"User","site_admin":false},"body":"- `run_turn` now performs each worker request in a new thread\r\n- actions are registered on the world map before they are applied\r\n- once all actions are registered, actions are applied in this order:\r\n    - wait actions\r\n    - attack actions\r\n    - move actions\r\n- avatars may be attacked in both their current location and their new location\r\n- if two or more avatars attempt to move to the same location, they all fail","created_at":"2016-07-28T17:58:49Z","updated_at":"2016-08-02T10:34:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b788d9a2a67ca98abb72e210579a347bf2d0ae7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/127/commits","review_comments_url":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/127/comments","review_comment_url":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ocadotechnology/aimmo/issues/127/comments","statuses_url":"https://api.github.com/repos/ocadotechnology/aimmo/statuses/f6b0fb88e3bb73bb947a81aa79c959f633428d04","head":{"label":"PhydeauxLeChien:concurrent-turns","ref":"concurrent-turns","sha":"f6b0fb88e3bb73bb947a81aa79c959f633428d04","user":{"login":"PhydeauxLeChien","id":7308018,"avatar_url":"https://avatars.githubusercontent.com/u/7308018?v=3","gravatar_id":"","url":"https://api.github.com/users/PhydeauxLeChien","html_url":"https://github.com/PhydeauxLeChien","followers_url":"https://api.github.com/users/PhydeauxLeChien/followers","following_url":"https://api.github.com/users/PhydeauxLeChien/following{/other_user}","gists_url":"https://api.github.com/users/PhydeauxLeChien/gists{/gist_id}","starred_url":"https://api.github.com/users/PhydeauxLeChien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhydeauxLeChien/subscriptions","organizations_url":"https://api.github.com/users/PhydeauxLeChien/orgs","repos_url":"https://api.github.com/users/PhydeauxLeChien/repos","events_url":"https://api.github.com/users/PhydeauxLeChien/events{/privacy}","received_events_url":"https://api.github.com/users/PhydeauxLeChien/received_events","type":"User","site_admin":false},"repo":{"id":62230201,"name":"aimmo","full_name":"PhydeauxLeChien/aimmo","owner":{"login":"PhydeauxLeChien","id":7308018,"avatar_url":"https://avatars.githubusercontent.com/u/7308018?v=3","gravatar_id":"","url":"https://api.github.com/users/PhydeauxLeChien","html_url":"https://github.com/PhydeauxLeChien","followers_url":"https://api.github.com/users/PhydeauxLeChien/followers","following_url":"https://api.github.com/users/PhydeauxLeChien/following{/other_user}","gists_url":"https://api.github.com/users/PhydeauxLeChien/gists{/gist_id}","starred_url":"https://api.github.com/users/PhydeauxLeChien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhydeauxLeChien/subscriptions","organizations_url":"https://api.github.com/users/PhydeauxLeChien/orgs","repos_url":"https://api.github.com/users/PhydeauxLeChien/repos","events_url":"https://api.github.com/users/PhydeauxLeChien/events{/privacy}","received_events_url":"https://api.github.com/users/PhydeauxLeChien/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PhydeauxLeChien/aimmo","description":"A Massively Multi-player Online game, where players create Artificially Intelligent programs to play on their behalf.","fork":true,"url":"https://api.github.com/repos/PhydeauxLeChien/aimmo","forks_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/forks","keys_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/teams","hooks_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/hooks","issue_events_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/issues/events{/number}","events_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/events","assignees_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/assignees{/user}","branches_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/branches{/branch}","tags_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/tags","blobs_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/git/refs{/sha}","trees_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/statuses/{sha}","languages_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/languages","stargazers_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/stargazers","contributors_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/contributors","subscribers_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/subscribers","subscription_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/subscription","commits_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/commits{/sha}","git_commits_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/git/commits{/sha}","comments_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/comments{/number}","issue_comment_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/issues/comments{/number}","contents_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/contents/{+path}","compare_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/merges","archive_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/downloads","issues_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/issues{/number}","pulls_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/pulls{/number}","milestones_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/milestones{/number}","notifications_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/labels{/name}","releases_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/releases{/id}","deployments_url":"https://api.github.com/repos/PhydeauxLeChien/aimmo/deployments","created_at":"2016-06-29T14:00:35Z","updated_at":"2016-06-29T14:00:36Z","pushed_at":"2016-08-02T10:14:44Z","git_url":"git://github.com/PhydeauxLeChien/aimmo.git","ssh_url":"git@github.com:PhydeauxLeChien/aimmo.git","clone_url":"https://github.com/PhydeauxLeChien/aimmo.git","svn_url":"https://github.com/PhydeauxLeChien/aimmo","homepage":"","size":337,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ocadotechnology:master","ref":"master","sha":"37ec2d708f904f9b034e7323cc82c80fdfc8846e","user":{"login":"ocadotechnology","id":2088731,"avatar_url":"https://avatars.githubusercontent.com/u/2088731?v=3","gravatar_id":"","url":"https://api.github.com/users/ocadotechnology","html_url":"https://github.com/ocadotechnology","followers_url":"https://api.github.com/users/ocadotechnology/followers","following_url":"https://api.github.com/users/ocadotechnology/following{/other_user}","gists_url":"https://api.github.com/users/ocadotechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/ocadotechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocadotechnology/subscriptions","organizations_url":"https://api.github.com/users/ocadotechnology/orgs","repos_url":"https://api.github.com/users/ocadotechnology/repos","events_url":"https://api.github.com/users/ocadotechnology/events{/privacy}","received_events_url":"https://api.github.com/users/ocadotechnology/received_events","type":"Organization","site_admin":false},"repo":{"id":39072690,"name":"aimmo","full_name":"ocadotechnology/aimmo","owner":{"login":"ocadotechnology","id":2088731,"avatar_url":"https://avatars.githubusercontent.com/u/2088731?v=3","gravatar_id":"","url":"https://api.github.com/users/ocadotechnology","html_url":"https://github.com/ocadotechnology","followers_url":"https://api.github.com/users/ocadotechnology/followers","following_url":"https://api.github.com/users/ocadotechnology/following{/other_user}","gists_url":"https://api.github.com/users/ocadotechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/ocadotechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocadotechnology/subscriptions","organizations_url":"https://api.github.com/users/ocadotechnology/orgs","repos_url":"https://api.github.com/users/ocadotechnology/repos","events_url":"https://api.github.com/users/ocadotechnology/events{/privacy}","received_events_url":"https://api.github.com/users/ocadotechnology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ocadotechnology/aimmo","description":"A Massively Multi-player Online game, where players create Artificially Intelligent programs to play on their behalf.","fork":false,"url":"https://api.github.com/repos/ocadotechnology/aimmo","forks_url":"https://api.github.com/repos/ocadotechnology/aimmo/forks","keys_url":"https://api.github.com/repos/ocadotechnology/aimmo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ocadotechnology/aimmo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ocadotechnology/aimmo/teams","hooks_url":"https://api.github.com/repos/ocadotechnology/aimmo/hooks","issue_events_url":"https://api.github.com/repos/ocadotechnology/aimmo/issues/events{/number}","events_url":"https://api.github.com/repos/ocadotechnology/aimmo/events","assignees_url":"https://api.github.com/repos/ocadotechnology/aimmo/assignees{/user}","branches_url":"https://api.github.com/repos/ocadotechnology/aimmo/branches{/branch}","tags_url":"https://api.github.com/repos/ocadotechnology/aimmo/tags","blobs_url":"https://api.github.com/repos/ocadotechnology/aimmo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ocadotechnology/aimmo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ocadotechnology/aimmo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ocadotechnology/aimmo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ocadotechnology/aimmo/statuses/{sha}","languages_url":"https://api.github.com/repos/ocadotechnology/aimmo/languages","stargazers_url":"https://api.github.com/repos/ocadotechnology/aimmo/stargazers","contributors_url":"https://api.github.com/repos/ocadotechnology/aimmo/contributors","subscribers_url":"https://api.github.com/repos/ocadotechnology/aimmo/subscribers","subscription_url":"https://api.github.com/repos/ocadotechnology/aimmo/subscription","commits_url":"https://api.github.com/repos/ocadotechnology/aimmo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ocadotechnology/aimmo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ocadotechnology/aimmo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ocadotechnology/aimmo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ocadotechnology/aimmo/contents/{+path}","compare_url":"https://api.github.com/repos/ocadotechnology/aimmo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ocadotechnology/aimmo/merges","archive_url":"https://api.github.com/repos/ocadotechnology/aimmo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ocadotechnology/aimmo/downloads","issues_url":"https://api.github.com/repos/ocadotechnology/aimmo/issues{/number}","pulls_url":"https://api.github.com/repos/ocadotechnology/aimmo/pulls{/number}","milestones_url":"https://api.github.com/repos/ocadotechnology/aimmo/milestones{/number}","notifications_url":"https://api.github.com/repos/ocadotechnology/aimmo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ocadotechnology/aimmo/labels{/name}","releases_url":"https://api.github.com/repos/ocadotechnology/aimmo/releases{/id}","deployments_url":"https://api.github.com/repos/ocadotechnology/aimmo/deployments","created_at":"2015-07-14T12:10:11Z","updated_at":"2016-04-13T21:15:06Z","pushed_at":"2016-08-02T10:14:44Z","git_url":"git://github.com/ocadotechnology/aimmo.git","ssh_url":"git@github.com:ocadotechnology/aimmo.git","clone_url":"https://github.com/ocadotechnology/aimmo.git","svn_url":"https://github.com/ocadotechnology/aimmo","homepage":"","size":402,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":35,"forks":11,"open_issues":35,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/127"},"html":{"href":"https://github.com/ocadotechnology/aimmo/pull/127"},"issue":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/issues/127"},"comments":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/ocadotechnology/aimmo/statuses/f6b0fb88e3bb73bb947a81aa79c959f633428d04"}}}}
{"actor":{"display_login":"PhydeauxLeChien"}}