{"action":"created","comment":{"url":"https://api.github.com/repos/seenbeen/bot/pulls/comments/192602332","pull_request_review_id":125408052,"id":192602332,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjYwMjMzMg==","diff_hunk":"@@ -0,0 +1,69 @@\n+from bot_fsm import *\n+import pygame\n+   \n+class InputManager(BOTFSM):\n+    \n+    @staticmethod\n+    def __runningInit(self):\n+        self.getFSM().resetInputs()\n+\n+    @staticmethod\n+    def __runningTransitionFrom(self, fromState):\n+        self.getFSM().resetInputs()\n+\n+    @staticmethod\n+    def __runningTransitionTo(self, toState):\n+        self.getFSM().resetInputs()\n+\n+    @staticmethod\n+    def __runningUpdate(self, deltaTime):\n+        self.getFSM().setInputs(pygame.event.get(), pygame.key.get_pressed, pygame.mouse.get_pos(), pygame.mouse.get_pressed())\n+\n+    @staticmethod\n+    def __runningLateUpdate(self):\n+        pass\n+    \n+    def resetInputs(self):\n+        self.keys = {}\n+        self.events = []\n+        self.mx, self.my = 0, 0\n+        self.mouseKeys = []\n+\n+    def setInputs(self, events, keys, mpos, mkeys):","path":"bot_framework/bot_inputmanager.py","position":32,"original_position":32,"commit_id":"06f27eb4eb743fb06df73f943688d6423fadd19f","original_commit_id":"06f27eb4eb743fb06df73f943688d6423fadd19f","user":{"login":"seenbeen","id":4283447,"node_id":"MDQ6VXNlcjQyODM0NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/4283447?v=4","gravatar_id":"","url":"https://api.github.com/users/seenbeen","html_url":"https://github.com/seenbeen","followers_url":"https://api.github.com/users/seenbeen/followers","following_url":"https://api.github.com/users/seenbeen/following{/other_user}","gists_url":"https://api.github.com/users/seenbeen/gists{/gist_id}","starred_url":"https://api.github.com/users/seenbeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seenbeen/subscriptions","organizations_url":"https://api.github.com/users/seenbeen/orgs","repos_url":"https://api.github.com/users/seenbeen/repos","events_url":"https://api.github.com/users/seenbeen/events{/privacy}","received_events_url":"https://api.github.com/users/seenbeen/received_events","type":"User","site_admin":false},"body":"Would prefer to not use arguments to set inputs, as changes or refactors might break a lot of different code places that use this. Maybe opt out for constant keys and setting them. This way we can make changes to the interface easier.\r\n\r\nEg:\r\n```python\r\nKEYS = 0\r\nEVENTS = 1\r\nMOUSE = 2\r\n...\r\ndef setInput(self, key, val):\r\n    if key == MOUSE:\r\n        self.foo, self.bar = val[0], val[1]\r\n    ...\r\n```","created_at":"2018-06-03T21:03:56Z","updated_at":"2018-06-03T21:14:05Z","html_url":"https://github.com/seenbeen/bot/pull/4#discussion_r192602332","pull_request_url":"https://api.github.com/repos/seenbeen/bot/pulls/4","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/seenbeen/bot/pulls/comments/192602332"},"html":{"href":"https://github.com/seenbeen/bot/pull/4#discussion_r192602332"},"pull_request":{"href":"https://api.github.com/repos/seenbeen/bot/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/seenbeen/bot/pulls/4","id":192260280,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjYwMjgw","html_url":"https://github.com/seenbeen/bot/pull/4","diff_url":"https://github.com/seenbeen/bot/pull/4.diff","patch_url":"https://github.com/seenbeen/bot/pull/4.patch","issue_url":"https://api.github.com/repos/seenbeen/bot/issues/4","number":4,"state":"open","locked":false,"title":"Created InputManager","user":{"login":"AshkanZirakzadeh","id":22134504,"node_id":"MDQ6VXNlcjIyMTM0NTA0","avatar_url":"https://avatars0.githubusercontent.com/u/22134504?v=4","gravatar_id":"","url":"https://api.github.com/users/AshkanZirakzadeh","html_url":"https://github.com/AshkanZirakzadeh","followers_url":"https://api.github.com/users/AshkanZirakzadeh/followers","following_url":"https://api.github.com/users/AshkanZirakzadeh/following{/other_user}","gists_url":"https://api.github.com/users/AshkanZirakzadeh/gists{/gist_id}","starred_url":"https://api.github.com/users/AshkanZirakzadeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AshkanZirakzadeh/subscriptions","organizations_url":"https://api.github.com/users/AshkanZirakzadeh/orgs","repos_url":"https://api.github.com/users/AshkanZirakzadeh/repos","events_url":"https://api.github.com/users/AshkanZirakzadeh/events{/privacy}","received_events_url":"https://api.github.com/users/AshkanZirakzadeh/received_events","type":"User","site_admin":false},"body":"All inputs should be obtained from this InputManager, and not directly from Pygame.\r\nImplemented using FSM, as we may require other states in the future for the InputManager","created_at":"2018-06-03T18:19:29Z","updated_at":"2018-06-03T21:14:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c0f639d2ebe1ef7111c56078b2a9d58a2219157","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/seenbeen/bot/pulls/4/commits","review_comments_url":"https://api.github.com/repos/seenbeen/bot/pulls/4/comments","review_comment_url":"https://api.github.com/repos/seenbeen/bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seenbeen/bot/issues/4/comments","statuses_url":"https://api.github.com/repos/seenbeen/bot/statuses/06f27eb4eb743fb06df73f943688d6423fadd19f","head":{"label":"seenbeen:Input-Subsystem","ref":"Input-Subsystem","sha":"06f27eb4eb743fb06df73f943688d6423fadd19f","user":{"login":"seenbeen","id":4283447,"node_id":"MDQ6VXNlcjQyODM0NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/4283447?v=4","gravatar_id":"","url":"https://api.github.com/users/seenbeen","html_url":"https://github.com/seenbeen","followers_url":"https://api.github.com/users/seenbeen/followers","following_url":"https://api.github.com/users/seenbeen/following{/other_user}","gists_url":"https://api.github.com/users/seenbeen/gists{/gist_id}","starred_url":"https://api.github.com/users/seenbeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seenbeen/subscriptions","organizations_url":"https://api.github.com/users/seenbeen/orgs","repos_url":"https://api.github.com/users/seenbeen/repos","events_url":"https://api.github.com/users/seenbeen/events{/privacy}","received_events_url":"https://api.github.com/users/seenbeen/received_events","type":"User","site_admin":false},"repo":{"id":134094849,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQwOTQ4NDk=","name":"bot","full_name":"seenbeen/bot","owner":{"login":"seenbeen","id":4283447,"node_id":"MDQ6VXNlcjQyODM0NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/4283447?v=4","gravatar_id":"","url":"https://api.github.com/users/seenbeen","html_url":"https://github.com/seenbeen","followers_url":"https://api.github.com/users/seenbeen/followers","following_url":"https://api.github.com/users/seenbeen/following{/other_user}","gists_url":"https://api.github.com/users/seenbeen/gists{/gist_id}","starred_url":"https://api.github.com/users/seenbeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seenbeen/subscriptions","organizations_url":"https://api.github.com/users/seenbeen/orgs","repos_url":"https://api.github.com/users/seenbeen/repos","events_url":"https://api.github.com/users/seenbeen/events{/privacy}","received_events_url":"https://api.github.com/users/seenbeen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seenbeen/bot","description":null,"fork":false,"url":"https://api.github.com/repos/seenbeen/bot","forks_url":"https://api.github.com/repos/seenbeen/bot/forks","keys_url":"https://api.github.com/repos/seenbeen/bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seenbeen/bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seenbeen/bot/teams","hooks_url":"https://api.github.com/repos/seenbeen/bot/hooks","issue_events_url":"https://api.github.com/repos/seenbeen/bot/issues/events{/number}","events_url":"https://api.github.com/repos/seenbeen/bot/events","assignees_url":"https://api.github.com/repos/seenbeen/bot/assignees{/user}","branches_url":"https://api.github.com/repos/seenbeen/bot/branches{/branch}","tags_url":"https://api.github.com/repos/seenbeen/bot/tags","blobs_url":"https://api.github.com/repos/seenbeen/bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seenbeen/bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seenbeen/bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/seenbeen/bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seenbeen/bot/statuses/{sha}","languages_url":"https://api.github.com/repos/seenbeen/bot/languages","stargazers_url":"https://api.github.com/repos/seenbeen/bot/stargazers","contributors_url":"https://api.github.com/repos/seenbeen/bot/contributors","subscribers_url":"https://api.github.com/repos/seenbeen/bot/subscribers","subscription_url":"https://api.github.com/repos/seenbeen/bot/subscription","commits_url":"https://api.github.com/repos/seenbeen/bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/seenbeen/bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/seenbeen/bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/seenbeen/bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/seenbeen/bot/contents/{+path}","compare_url":"https://api.github.com/repos/seenbeen/bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seenbeen/bot/merges","archive_url":"https://api.github.com/repos/seenbeen/bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seenbeen/bot/downloads","issues_url":"https://api.github.com/repos/seenbeen/bot/issues{/number}","pulls_url":"https://api.github.com/repos/seenbeen/bot/pulls{/number}","milestones_url":"https://api.github.com/repos/seenbeen/bot/milestones{/number}","notifications_url":"https://api.github.com/repos/seenbeen/bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seenbeen/bot/labels{/name}","releases_url":"https://api.github.com/repos/seenbeen/bot/releases{/id}","deployments_url":"https://api.github.com/repos/seenbeen/bot/deployments","created_at":"2018-05-19T20:12:19Z","updated_at":"2018-06-02T23:21:25Z","pushed_at":"2018-06-03T18:19:30Z","git_url":"git://github.com/seenbeen/bot.git","ssh_url":"git@github.com:seenbeen/bot.git","clone_url":"https://github.com/seenbeen/bot.git","svn_url":"https://github.com/seenbeen/bot","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"seenbeen:master","ref":"master","sha":"13c23a951d2a17c7a0c105298a987e5b611a15cb","user":{"login":"seenbeen","id":4283447,"node_id":"MDQ6VXNlcjQyODM0NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/4283447?v=4","gravatar_id":"","url":"https://api.github.com/users/seenbeen","html_url":"https://github.com/seenbeen","followers_url":"https://api.github.com/users/seenbeen/followers","following_url":"https://api.github.com/users/seenbeen/following{/other_user}","gists_url":"https://api.github.com/users/seenbeen/gists{/gist_id}","starred_url":"https://api.github.com/users/seenbeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seenbeen/subscriptions","organizations_url":"https://api.github.com/users/seenbeen/orgs","repos_url":"https://api.github.com/users/seenbeen/repos","events_url":"https://api.github.com/users/seenbeen/events{/privacy}","received_events_url":"https://api.github.com/users/seenbeen/received_events","type":"User","site_admin":false},"repo":{"id":134094849,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQwOTQ4NDk=","name":"bot","full_name":"seenbeen/bot","owner":{"login":"seenbeen","id":4283447,"node_id":"MDQ6VXNlcjQyODM0NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/4283447?v=4","gravatar_id":"","url":"https://api.github.com/users/seenbeen","html_url":"https://github.com/seenbeen","followers_url":"https://api.github.com/users/seenbeen/followers","following_url":"https://api.github.com/users/seenbeen/following{/other_user}","gists_url":"https://api.github.com/users/seenbeen/gists{/gist_id}","starred_url":"https://api.github.com/users/seenbeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seenbeen/subscriptions","organizations_url":"https://api.github.com/users/seenbeen/orgs","repos_url":"https://api.github.com/users/seenbeen/repos","events_url":"https://api.github.com/users/seenbeen/events{/privacy}","received_events_url":"https://api.github.com/users/seenbeen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seenbeen/bot","description":null,"fork":false,"url":"https://api.github.com/repos/seenbeen/bot","forks_url":"https://api.github.com/repos/seenbeen/bot/forks","keys_url":"https://api.github.com/repos/seenbeen/bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seenbeen/bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seenbeen/bot/teams","hooks_url":"https://api.github.com/repos/seenbeen/bot/hooks","issue_events_url":"https://api.github.com/repos/seenbeen/bot/issues/events{/number}","events_url":"https://api.github.com/repos/seenbeen/bot/events","assignees_url":"https://api.github.com/repos/seenbeen/bot/assignees{/user}","branches_url":"https://api.github.com/repos/seenbeen/bot/branches{/branch}","tags_url":"https://api.github.com/repos/seenbeen/bot/tags","blobs_url":"https://api.github.com/repos/seenbeen/bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seenbeen/bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seenbeen/bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/seenbeen/bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seenbeen/bot/statuses/{sha}","languages_url":"https://api.github.com/repos/seenbeen/bot/languages","stargazers_url":"https://api.github.com/repos/seenbeen/bot/stargazers","contributors_url":"https://api.github.com/repos/seenbeen/bot/contributors","subscribers_url":"https://api.github.com/repos/seenbeen/bot/subscribers","subscription_url":"https://api.github.com/repos/seenbeen/bot/subscription","commits_url":"https://api.github.com/repos/seenbeen/bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/seenbeen/bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/seenbeen/bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/seenbeen/bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/seenbeen/bot/contents/{+path}","compare_url":"https://api.github.com/repos/seenbeen/bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seenbeen/bot/merges","archive_url":"https://api.github.com/repos/seenbeen/bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seenbeen/bot/downloads","issues_url":"https://api.github.com/repos/seenbeen/bot/issues{/number}","pulls_url":"https://api.github.com/repos/seenbeen/bot/pulls{/number}","milestones_url":"https://api.github.com/repos/seenbeen/bot/milestones{/number}","notifications_url":"https://api.github.com/repos/seenbeen/bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seenbeen/bot/labels{/name}","releases_url":"https://api.github.com/repos/seenbeen/bot/releases{/id}","deployments_url":"https://api.github.com/repos/seenbeen/bot/deployments","created_at":"2018-05-19T20:12:19Z","updated_at":"2018-06-02T23:21:25Z","pushed_at":"2018-06-03T18:19:30Z","git_url":"git://github.com/seenbeen/bot.git","ssh_url":"git@github.com:seenbeen/bot.git","clone_url":"https://github.com/seenbeen/bot.git","svn_url":"https://github.com/seenbeen/bot","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seenbeen/bot/pulls/4"},"html":{"href":"https://github.com/seenbeen/bot/pull/4"},"issue":{"href":"https://api.github.com/repos/seenbeen/bot/issues/4"},"comments":{"href":"https://api.github.com/repos/seenbeen/bot/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/seenbeen/bot/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/seenbeen/bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seenbeen/bot/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/seenbeen/bot/statuses/06f27eb4eb743fb06df73f943688d6423fadd19f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"seenbeen"}}