{"action":"created","comment":{"url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/comments/187812349","pull_request_review_id":119665624,"id":187812349,"diff_hunk":"@@ -0,0 +1,120 @@\n+#include \"EventHandlers.hpp\"\n+\n+#include <assert.h>\n+#include <iostream>\n+\n+\n+/********************************************************************\n+*\t\t\t\t\t\t\t\t//\n+********************************************************************/\n+\n+KeyHandler_base::KeyHandler_base(EventCollector& collector)\n+\t: collector(collector)\n+{}\n+\n+void KeyHandler_base::SetKeyMode(const sf::Event& ega, KeyEventType& event)\n+{\n+\tswitch (ega.type) {\n+\tcase sf::Keyboard::LAlt\t\t\t\t\t:\tevent.modifier = EKeyModifier::eAlt;\tbreak;\n+\tcase sf::Keyboard::LControl\t\t:\tevent.modifier = EKeyModifier::eCtrl;\tbreak;\n+\tcase sf::Keyboard::LShift\t\t\t:\tevent.modifier = EKeyModifier::eShift;\tbreak;\n+\t}\n+}\n+\n+void KeyHandler_base::SetMousePos(const  sf::Event& ega)\n+{\n+\t/*float x = (ega.getX()-ega.getXmin()) / (ega.getXmax()-ega.getXmin()) * ega.getWindowWidth ();\n+\tfloat y = (ega.getY()-ega.getYmin()) / (ega.getYmax()-ega.getYmin()) * ega.getWindowHeight();\n+\tcollector.CollectMousPosition(x, y);*/\n+}\n+\n+void KeyHandler_base::Store(KeyEventType event)\n+{\n+\tcollector.CollectKeyEvent(event);\n+}\n+\n+\n+/********************************************************************\n+*\t\t\t\t\t\t\t\tMouse\n+********************************************************************/\n+\n+MouseHandler::MouseHandler(EventCollector& collector)\n+\t: KeyHandler_base(collector)\n+{}\n+\n+bool MouseHandler::handle(const sf::Event& ega)\n+{\n+\tauto eventType = ega.type;\n+\t\n+\n+\tKeyEventType event;\n+\n+\tswitch (eventType) {\n+\tcase sf::Event::MouseButtonPressed:  event.action = BA_Pressed;\t\tbreak; \n+\tcase sf::Event::MouseButtonReleased\t\t\t\t:\tevent.action = BA_Released;\t\tbreak;\n+\tcase sf::Event::Closed\t\t\t\t\t\t\t:   std::cout << \"close button\";\n+\tcase sf::Event::MouseMoved\t\t\t\t\t\t:\tSetMousePos(ega);\t\t\t\treturn false; //TODO:\n+\tcase sf::Event::MouseWheelMoved\t\t\t\t\t:\t\t\treturn false; //TODO:\n+\tdefault: return false;\n+\t}\n+\n+\t\t\n+\tif (sf::Mouse::isButtonPressed(sf::Mouse::Left)) event.key = KEY_MOUSE_L;\t\n+\tif (sf::Mouse::isButtonPressed(sf::Mouse::Right)) event.key = KEY_MOUSE_R;\n+\t\n+\n+\tSetKeyMode(ega, event);\n+\tStore(event);\n+\n+\treturn true;\n+}\n+\n+/********************************************************************\n+*\t\t\t\t\t\t\t\tKeyboar\n+********************************************************************/\n+\n+\n+KeyboardHandler::KeyboardHandler(EventCollector& collector)\n+\t: KeyHandler_base(collector)\n+{}\n+\n+bool KeyboardHandler::handle(const sf::Event& ega)\n+{\n+\tauto eventType = ega.type;\n+\tint button = ega.key.code;\n+\t\n+\tKeyEventType event;\n+\tswitch (eventType) {\n+\tcase sf::Event::KeyPressed\t\t:\tevent.action = EKeyAction::BA_Pressed;  break;\n+\tcase sf::Event::KeyReleased\t\t:\tevent.action = EKeyAction::BA_Released; break;\n+\tdefault: return false;\n+\t}\n+\t\n+\n+\tswitch (button) {\n+\tcase sf::Keyboard::Key::Down\t\t:\t break;\n+\tcase sf::Keyboard::Key::Up\t\t\t:\t break;\n+\tcase sf::Keyboard::Key::Return\t\t:\tevent.key = KEY_ENTER;\t\tbreak;\n+\tcase sf::Keyboard::Key::Tab\t\t\t:\tevent.key = KEY_TAB;\t\tbreak;\n+\tcase sf::Keyboard::Key::Escape\t\t:\tevent.key = KEY_ESCAPE;\t\tbreak;\n+\t\n+\tdefault:\n+\t\tswitch (button) {\n+\t\tcase sf::Keyboard::Key::R:\t\t\tbutton = 114; event.key = (EInputKey)button; break;","path":"Engine/Modules/SFML/Sources/Control/EventHandlers.cpp","position":103,"original_position":103,"commit_id":"ea6f0137e62273a4e979c71d4fa8219f56834a16","original_commit_id":"ea6f0137e62273a4e979c71d4fa8219f56834a16","user":{"login":"makdenis","id":21059115,"avatar_url":"https://avatars2.githubusercontent.com/u/21059115?v=4","gravatar_id":"","url":"https://api.github.com/users/makdenis","html_url":"https://github.com/makdenis","followers_url":"https://api.github.com/users/makdenis/followers","following_url":"https://api.github.com/users/makdenis/following{/other_user}","gists_url":"https://api.github.com/users/makdenis/gists{/gist_id}","starred_url":"https://api.github.com/users/makdenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makdenis/subscriptions","organizations_url":"https://api.github.com/users/makdenis/orgs","repos_url":"https://api.github.com/users/makdenis/repos","events_url":"https://api.github.com/users/makdenis/events{/privacy}","received_events_url":"https://api.github.com/users/makdenis/received_events","type":"User","site_admin":false},"body":"Это связано с работой движка, нам надо приводить код нажатия клавиш из sfml в наши собственные коды.","created_at":"2018-05-13T20:18:55Z","updated_at":"2018-05-13T20:18:56Z","html_url":"https://github.com/bomkvilt/YetAnotherProject/pull/12#discussion_r187812349","pull_request_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/12","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/comments/187812349"},"html":{"href":"https://github.com/bomkvilt/YetAnotherProject/pull/12#discussion_r187812349"},"pull_request":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/12"}},"in_reply_to_id":187792625},"pull_request":{"url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/12","id":186327348,"html_url":"https://github.com/bomkvilt/YetAnotherProject/pull/12","diff_url":"https://github.com/bomkvilt/YetAnotherProject/pull/12.diff","patch_url":"https://github.com/bomkvilt/YetAnotherProject/pull/12.patch","issue_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/issues/12","number":12,"state":"open","locked":false,"title":"Sfml (ревью по 1 и 2 модулю)","user":{"login":"makdenis","id":21059115,"avatar_url":"https://avatars2.githubusercontent.com/u/21059115?v=4","gravatar_id":"","url":"https://api.github.com/users/makdenis","html_url":"https://github.com/makdenis","followers_url":"https://api.github.com/users/makdenis/followers","following_url":"https://api.github.com/users/makdenis/following{/other_user}","gists_url":"https://api.github.com/users/makdenis/gists{/gist_id}","starred_url":"https://api.github.com/users/makdenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makdenis/subscriptions","organizations_url":"https://api.github.com/users/makdenis/orgs","repos_url":"https://api.github.com/users/makdenis/repos","events_url":"https://api.github.com/users/makdenis/events{/privacy}","received_events_url":"https://api.github.com/users/makdenis/received_events","type":"User","site_admin":false},"body":"Мы с Дашей отвечали за графическую часть, все наши файлы лежат в папке engine/modules/sfml","created_at":"2018-05-07T11:41:03Z","updated_at":"2018-05-13T20:18:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[{"login":"bomkvilt","id":24719038,"avatar_url":"https://avatars3.githubusercontent.com/u/24719038?v=4","gravatar_id":"","url":"https://api.github.com/users/bomkvilt","html_url":"https://github.com/bomkvilt","followers_url":"https://api.github.com/users/bomkvilt/followers","following_url":"https://api.github.com/users/bomkvilt/following{/other_user}","gists_url":"https://api.github.com/users/bomkvilt/gists{/gist_id}","starred_url":"https://api.github.com/users/bomkvilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bomkvilt/subscriptions","organizations_url":"https://api.github.com/users/bomkvilt/orgs","repos_url":"https://api.github.com/users/bomkvilt/repos","events_url":"https://api.github.com/users/bomkvilt/events{/privacy}","received_events_url":"https://api.github.com/users/bomkvilt/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/12/commits","review_comments_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/12/comments","review_comment_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/issues/12/comments","statuses_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/statuses/ea6f0137e62273a4e979c71d4fa8219f56834a16","head":{"label":"makdenis:sfml","ref":"sfml","sha":"ea6f0137e62273a4e979c71d4fa8219f56834a16","user":{"login":"makdenis","id":21059115,"avatar_url":"https://avatars2.githubusercontent.com/u/21059115?v=4","gravatar_id":"","url":"https://api.github.com/users/makdenis","html_url":"https://github.com/makdenis","followers_url":"https://api.github.com/users/makdenis/followers","following_url":"https://api.github.com/users/makdenis/following{/other_user}","gists_url":"https://api.github.com/users/makdenis/gists{/gist_id}","starred_url":"https://api.github.com/users/makdenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makdenis/subscriptions","organizations_url":"https://api.github.com/users/makdenis/orgs","repos_url":"https://api.github.com/users/makdenis/repos","events_url":"https://api.github.com/users/makdenis/events{/privacy}","received_events_url":"https://api.github.com/users/makdenis/received_events","type":"User","site_admin":false},"repo":{"id":132372541,"name":"YetAnotherProject","full_name":"makdenis/YetAnotherProject","owner":{"login":"makdenis","id":21059115,"avatar_url":"https://avatars2.githubusercontent.com/u/21059115?v=4","gravatar_id":"","url":"https://api.github.com/users/makdenis","html_url":"https://github.com/makdenis","followers_url":"https://api.github.com/users/makdenis/followers","following_url":"https://api.github.com/users/makdenis/following{/other_user}","gists_url":"https://api.github.com/users/makdenis/gists{/gist_id}","starred_url":"https://api.github.com/users/makdenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makdenis/subscriptions","organizations_url":"https://api.github.com/users/makdenis/orgs","repos_url":"https://api.github.com/users/makdenis/repos","events_url":"https://api.github.com/users/makdenis/events{/privacy}","received_events_url":"https://api.github.com/users/makdenis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/makdenis/YetAnotherProject","description":"Технопарк Mail.ru. С++ весна 2018. Курсовой проект.","fork":true,"url":"https://api.github.com/repos/makdenis/YetAnotherProject","forks_url":"https://api.github.com/repos/makdenis/YetAnotherProject/forks","keys_url":"https://api.github.com/repos/makdenis/YetAnotherProject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makdenis/YetAnotherProject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makdenis/YetAnotherProject/teams","hooks_url":"https://api.github.com/repos/makdenis/YetAnotherProject/hooks","issue_events_url":"https://api.github.com/repos/makdenis/YetAnotherProject/issues/events{/number}","events_url":"https://api.github.com/repos/makdenis/YetAnotherProject/events","assignees_url":"https://api.github.com/repos/makdenis/YetAnotherProject/assignees{/user}","branches_url":"https://api.github.com/repos/makdenis/YetAnotherProject/branches{/branch}","tags_url":"https://api.github.com/repos/makdenis/YetAnotherProject/tags","blobs_url":"https://api.github.com/repos/makdenis/YetAnotherProject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makdenis/YetAnotherProject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makdenis/YetAnotherProject/git/refs{/sha}","trees_url":"https://api.github.com/repos/makdenis/YetAnotherProject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makdenis/YetAnotherProject/statuses/{sha}","languages_url":"https://api.github.com/repos/makdenis/YetAnotherProject/languages","stargazers_url":"https://api.github.com/repos/makdenis/YetAnotherProject/stargazers","contributors_url":"https://api.github.com/repos/makdenis/YetAnotherProject/contributors","subscribers_url":"https://api.github.com/repos/makdenis/YetAnotherProject/subscribers","subscription_url":"https://api.github.com/repos/makdenis/YetAnotherProject/subscription","commits_url":"https://api.github.com/repos/makdenis/YetAnotherProject/commits{/sha}","git_commits_url":"https://api.github.com/repos/makdenis/YetAnotherProject/git/commits{/sha}","comments_url":"https://api.github.com/repos/makdenis/YetAnotherProject/comments{/number}","issue_comment_url":"https://api.github.com/repos/makdenis/YetAnotherProject/issues/comments{/number}","contents_url":"https://api.github.com/repos/makdenis/YetAnotherProject/contents/{+path}","compare_url":"https://api.github.com/repos/makdenis/YetAnotherProject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makdenis/YetAnotherProject/merges","archive_url":"https://api.github.com/repos/makdenis/YetAnotherProject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makdenis/YetAnotherProject/downloads","issues_url":"https://api.github.com/repos/makdenis/YetAnotherProject/issues{/number}","pulls_url":"https://api.github.com/repos/makdenis/YetAnotherProject/pulls{/number}","milestones_url":"https://api.github.com/repos/makdenis/YetAnotherProject/milestones{/number}","notifications_url":"https://api.github.com/repos/makdenis/YetAnotherProject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makdenis/YetAnotherProject/labels{/name}","releases_url":"https://api.github.com/repos/makdenis/YetAnotherProject/releases{/id}","deployments_url":"https://api.github.com/repos/makdenis/YetAnotherProject/deployments","created_at":"2018-05-06T20:14:19Z","updated_at":"2018-05-06T20:14:51Z","pushed_at":"2018-05-06T21:06:30Z","git_url":"git://github.com/makdenis/YetAnotherProject.git","ssh_url":"git@github.com:makdenis/YetAnotherProject.git","clone_url":"https://github.com/makdenis/YetAnotherProject.git","svn_url":"https://github.com/makdenis/YetAnotherProject","homepage":"","size":36539,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bomkvilt:dev","ref":"dev","sha":"624558f84e1699852b0931d92cd07e8fa361ac4b","user":{"login":"bomkvilt","id":24719038,"avatar_url":"https://avatars3.githubusercontent.com/u/24719038?v=4","gravatar_id":"","url":"https://api.github.com/users/bomkvilt","html_url":"https://github.com/bomkvilt","followers_url":"https://api.github.com/users/bomkvilt/followers","following_url":"https://api.github.com/users/bomkvilt/following{/other_user}","gists_url":"https://api.github.com/users/bomkvilt/gists{/gist_id}","starred_url":"https://api.github.com/users/bomkvilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bomkvilt/subscriptions","organizations_url":"https://api.github.com/users/bomkvilt/orgs","repos_url":"https://api.github.com/users/bomkvilt/repos","events_url":"https://api.github.com/users/bomkvilt/events{/privacy}","received_events_url":"https://api.github.com/users/bomkvilt/received_events","type":"User","site_admin":false},"repo":{"id":125628652,"name":"YetAnotherProject","full_name":"bomkvilt/YetAnotherProject","owner":{"login":"bomkvilt","id":24719038,"avatar_url":"https://avatars3.githubusercontent.com/u/24719038?v=4","gravatar_id":"","url":"https://api.github.com/users/bomkvilt","html_url":"https://github.com/bomkvilt","followers_url":"https://api.github.com/users/bomkvilt/followers","following_url":"https://api.github.com/users/bomkvilt/following{/other_user}","gists_url":"https://api.github.com/users/bomkvilt/gists{/gist_id}","starred_url":"https://api.github.com/users/bomkvilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bomkvilt/subscriptions","organizations_url":"https://api.github.com/users/bomkvilt/orgs","repos_url":"https://api.github.com/users/bomkvilt/repos","events_url":"https://api.github.com/users/bomkvilt/events{/privacy}","received_events_url":"https://api.github.com/users/bomkvilt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bomkvilt/YetAnotherProject","description":"Технопарк Mail.ru. С++ весна 2018. Курсовой проект.","fork":false,"url":"https://api.github.com/repos/bomkvilt/YetAnotherProject","forks_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/forks","keys_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/teams","hooks_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/hooks","issue_events_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/issues/events{/number}","events_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/events","assignees_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/assignees{/user}","branches_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/branches{/branch}","tags_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/tags","blobs_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/git/refs{/sha}","trees_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/statuses/{sha}","languages_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/languages","stargazers_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/stargazers","contributors_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/contributors","subscribers_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/subscribers","subscription_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/subscription","commits_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/commits{/sha}","git_commits_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/git/commits{/sha}","comments_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/comments{/number}","issue_comment_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/issues/comments{/number}","contents_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/contents/{+path}","compare_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/merges","archive_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/downloads","issues_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/issues{/number}","pulls_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls{/number}","milestones_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/milestones{/number}","notifications_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/labels{/name}","releases_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/releases{/id}","deployments_url":"https://api.github.com/repos/bomkvilt/YetAnotherProject/deployments","created_at":"2018-03-17T12:50:06Z","updated_at":"2018-05-02T10:40:27Z","pushed_at":"2018-05-13T10:30:09Z","git_url":"git://github.com/bomkvilt/YetAnotherProject.git","ssh_url":"git@github.com:bomkvilt/YetAnotherProject.git","clone_url":"https://github.com/bomkvilt/YetAnotherProject.git","svn_url":"https://github.com/bomkvilt/YetAnotherProject","homepage":"","size":36596,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/12"},"html":{"href":"https://github.com/bomkvilt/YetAnotherProject/pull/12"},"issue":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/issues/12"},"comments":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/bomkvilt/YetAnotherProject/statuses/ea6f0137e62273a4e979c71d4fa8219f56834a16"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"makdenis"}}