{"action":"created","comment":{"url":"https://api.github.com/repos/jean553/Memoris/pulls/comments/53420536","id":53420536,"diff_hunk":"@@ -0,0 +1,62 @@\n+/**\n+ * Memoris\n+ * Copyright (C) 2015  Jean LELIEVRE\n+ *\n+ * This program is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+*/\n+\n+/**\n+ * Policy for menu selector animation\n+ *\n+ * @file HasMenuSelectorAnimation.cpp\n+ * @brief policy for menu selector animation\n+ * @package policies\n+ * @author Jean LELIEVRE <Jean.LELIEVRE@supinfo.com>\n+ */\n+\n+#include \"HasMenuSelectorAnimation.hpp\"\n+#include \"MainMenuController.hpp\"\n+#include \"EditorMenuController.hpp\"\n+\n+using namespace policies;\n+\n+const short HasMenuSelectorAnimation::SELECTOR_COLOR_INCREMENTATION_STEP = 15;\n+const int HasMenuSelectorAnimation::INTERVAL_ANIMATION = 10;\n+\n+sf::Clock HasMenuSelectorAnimation::clock;\n+\n+template<typename T>\n+void HasMenuSelectorAnimation::animateMenuSelector(T* menuController)\n+{\n+    if(clock.getElapsedTime().asMilliseconds() <= INTERVAL_ANIMATION) {\n+        return;\n+    }\n+\n+    menuController->colorSelector.g +=\n+        SELECTOR_COLOR_INCREMENTATION_STEP * menuController->selectorDirection;\n+    menuController->colorSelector.b +=\n+        SELECTOR_COLOR_INCREMENTATION_STEP * menuController->selectorDirection;\n+\n+    if (\n+        menuController->colorSelector.g == 0 ||\n+        menuController->colorSelector.g == 255","path":"src/policies/HasMenuSelectorAnimation.cpp","position":53,"original_position":53,"commit_id":"16154fc13f3e1ce5c4a183c45265a6f9c38bea17","original_commit_id":"16154fc13f3e1ce5c4a183c45265a6f9c38bea17","user":{"login":"jean553","id":8011398,"avatar_url":"https://avatars.githubusercontent.com/u/8011398?v=3","gravatar_id":"","url":"https://api.github.com/users/jean553","html_url":"https://github.com/jean553","followers_url":"https://api.github.com/users/jean553/followers","following_url":"https://api.github.com/users/jean553/following{/other_user}","gists_url":"https://api.github.com/users/jean553/gists{/gist_id}","starred_url":"https://api.github.com/users/jean553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean553/subscriptions","organizations_url":"https://api.github.com/users/jean553/orgs","repos_url":"https://api.github.com/users/jean553/repos","events_url":"https://api.github.com/users/jean553/events{/privacy}","received_events_url":"https://api.github.com/users/jean553/received_events","type":"User","site_admin":false},"body":"0 and 255 should be constants","created_at":"2016-02-19T04:01:04Z","updated_at":"2016-02-19T04:01:04Z","html_url":"https://github.com/jean553/Memoris/pull/226#discussion_r53420536","pull_request_url":"https://api.github.com/repos/jean553/Memoris/pulls/226","_links":{"self":{"href":"https://api.github.com/repos/jean553/Memoris/pulls/comments/53420536"},"html":{"href":"https://github.com/jean553/Memoris/pull/226#discussion_r53420536"},"pull_request":{"href":"https://api.github.com/repos/jean553/Memoris/pulls/226"}}},"pull_request":{"url":"https://api.github.com/repos/jean553/Memoris/pulls/226","id":59819413,"html_url":"https://github.com/jean553/Memoris/pull/226","diff_url":"https://github.com/jean553/Memoris/pull/226.diff","patch_url":"https://github.com/jean553/Memoris/pull/226.patch","issue_url":"https://api.github.com/repos/jean553/Memoris/issues/226","number":226,"state":"open","locked":false,"title":"Refactor the editor menu and main menu animation in dedicated","user":{"login":"jean553","id":8011398,"avatar_url":"https://avatars.githubusercontent.com/u/8011398?v=3","gravatar_id":"","url":"https://api.github.com/users/jean553","html_url":"https://github.com/jean553","followers_url":"https://api.github.com/users/jean553/followers","following_url":"https://api.github.com/users/jean553/following{/other_user}","gists_url":"https://api.github.com/users/jean553/gists{/gist_id}","starred_url":"https://api.github.com/users/jean553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean553/subscriptions","organizations_url":"https://api.github.com/users/jean553/orgs","repos_url":"https://api.github.com/users/jean553/repos","events_url":"https://api.github.com/users/jean553/events{/privacy}","received_events_url":"https://api.github.com/users/jean553/received_events","type":"User","site_admin":false},"body":"template trait","created_at":"2016-02-18T15:56:55Z","updated_at":"2016-02-19T04:01:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b4d8c75824f323bf56d0360539a627747bf76bf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jean553/Memoris/pulls/226/commits","review_comments_url":"https://api.github.com/repos/jean553/Memoris/pulls/226/comments","review_comment_url":"https://api.github.com/repos/jean553/Memoris/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jean553/Memoris/issues/226/comments","statuses_url":"https://api.github.com/repos/jean553/Memoris/statuses/16154fc13f3e1ce5c4a183c45265a6f9c38bea17","head":{"label":"jean553:editor_menu_animate_selector","ref":"editor_menu_animate_selector","sha":"16154fc13f3e1ce5c4a183c45265a6f9c38bea17","user":{"login":"jean553","id":8011398,"avatar_url":"https://avatars.githubusercontent.com/u/8011398?v=3","gravatar_id":"","url":"https://api.github.com/users/jean553","html_url":"https://github.com/jean553","followers_url":"https://api.github.com/users/jean553/followers","following_url":"https://api.github.com/users/jean553/following{/other_user}","gists_url":"https://api.github.com/users/jean553/gists{/gist_id}","starred_url":"https://api.github.com/users/jean553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean553/subscriptions","organizations_url":"https://api.github.com/users/jean553/orgs","repos_url":"https://api.github.com/users/jean553/repos","events_url":"https://api.github.com/users/jean553/events{/privacy}","received_events_url":"https://api.github.com/users/jean553/received_events","type":"User","site_admin":false},"repo":{"id":33491186,"name":"Memoris","full_name":"jean553/Memoris","owner":{"login":"jean553","id":8011398,"avatar_url":"https://avatars.githubusercontent.com/u/8011398?v=3","gravatar_id":"","url":"https://api.github.com/users/jean553","html_url":"https://github.com/jean553","followers_url":"https://api.github.com/users/jean553/followers","following_url":"https://api.github.com/users/jean553/following{/other_user}","gists_url":"https://api.github.com/users/jean553/gists{/gist_id}","starred_url":"https://api.github.com/users/jean553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean553/subscriptions","organizations_url":"https://api.github.com/users/jean553/orgs","repos_url":"https://api.github.com/users/jean553/repos","events_url":"https://api.github.com/users/jean553/events{/privacy}","received_events_url":"https://api.github.com/users/jean553/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jean553/Memoris","description":"Memoris is a 2D graphical video game developped in C++ using the SFML media library.","fork":false,"url":"https://api.github.com/repos/jean553/Memoris","forks_url":"https://api.github.com/repos/jean553/Memoris/forks","keys_url":"https://api.github.com/repos/jean553/Memoris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jean553/Memoris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jean553/Memoris/teams","hooks_url":"https://api.github.com/repos/jean553/Memoris/hooks","issue_events_url":"https://api.github.com/repos/jean553/Memoris/issues/events{/number}","events_url":"https://api.github.com/repos/jean553/Memoris/events","assignees_url":"https://api.github.com/repos/jean553/Memoris/assignees{/user}","branches_url":"https://api.github.com/repos/jean553/Memoris/branches{/branch}","tags_url":"https://api.github.com/repos/jean553/Memoris/tags","blobs_url":"https://api.github.com/repos/jean553/Memoris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jean553/Memoris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jean553/Memoris/git/refs{/sha}","trees_url":"https://api.github.com/repos/jean553/Memoris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jean553/Memoris/statuses/{sha}","languages_url":"https://api.github.com/repos/jean553/Memoris/languages","stargazers_url":"https://api.github.com/repos/jean553/Memoris/stargazers","contributors_url":"https://api.github.com/repos/jean553/Memoris/contributors","subscribers_url":"https://api.github.com/repos/jean553/Memoris/subscribers","subscription_url":"https://api.github.com/repos/jean553/Memoris/subscription","commits_url":"https://api.github.com/repos/jean553/Memoris/commits{/sha}","git_commits_url":"https://api.github.com/repos/jean553/Memoris/git/commits{/sha}","comments_url":"https://api.github.com/repos/jean553/Memoris/comments{/number}","issue_comment_url":"https://api.github.com/repos/jean553/Memoris/issues/comments{/number}","contents_url":"https://api.github.com/repos/jean553/Memoris/contents/{+path}","compare_url":"https://api.github.com/repos/jean553/Memoris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jean553/Memoris/merges","archive_url":"https://api.github.com/repos/jean553/Memoris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jean553/Memoris/downloads","issues_url":"https://api.github.com/repos/jean553/Memoris/issues{/number}","pulls_url":"https://api.github.com/repos/jean553/Memoris/pulls{/number}","milestones_url":"https://api.github.com/repos/jean553/Memoris/milestones{/number}","notifications_url":"https://api.github.com/repos/jean553/Memoris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jean553/Memoris/labels{/name}","releases_url":"https://api.github.com/repos/jean553/Memoris/releases{/id}","deployments_url":"https://api.github.com/repos/jean553/Memoris/deployments","created_at":"2015-04-06T16:07:52Z","updated_at":"2016-01-15T13:58:50Z","pushed_at":"2016-02-18T16:12:30Z","git_url":"git://github.com/jean553/Memoris.git","ssh_url":"git@github.com:jean553/Memoris.git","clone_url":"https://github.com/jean553/Memoris.git","svn_url":"https://github.com/jean553/Memoris","homepage":"","size":21609,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"jean553:master","ref":"master","sha":"f93763fe0c23c65283410851df22a9ff1c9f8a7f","user":{"login":"jean553","id":8011398,"avatar_url":"https://avatars.githubusercontent.com/u/8011398?v=3","gravatar_id":"","url":"https://api.github.com/users/jean553","html_url":"https://github.com/jean553","followers_url":"https://api.github.com/users/jean553/followers","following_url":"https://api.github.com/users/jean553/following{/other_user}","gists_url":"https://api.github.com/users/jean553/gists{/gist_id}","starred_url":"https://api.github.com/users/jean553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean553/subscriptions","organizations_url":"https://api.github.com/users/jean553/orgs","repos_url":"https://api.github.com/users/jean553/repos","events_url":"https://api.github.com/users/jean553/events{/privacy}","received_events_url":"https://api.github.com/users/jean553/received_events","type":"User","site_admin":false},"repo":{"id":33491186,"name":"Memoris","full_name":"jean553/Memoris","owner":{"login":"jean553","id":8011398,"avatar_url":"https://avatars.githubusercontent.com/u/8011398?v=3","gravatar_id":"","url":"https://api.github.com/users/jean553","html_url":"https://github.com/jean553","followers_url":"https://api.github.com/users/jean553/followers","following_url":"https://api.github.com/users/jean553/following{/other_user}","gists_url":"https://api.github.com/users/jean553/gists{/gist_id}","starred_url":"https://api.github.com/users/jean553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean553/subscriptions","organizations_url":"https://api.github.com/users/jean553/orgs","repos_url":"https://api.github.com/users/jean553/repos","events_url":"https://api.github.com/users/jean553/events{/privacy}","received_events_url":"https://api.github.com/users/jean553/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jean553/Memoris","description":"Memoris is a 2D graphical video game developped in C++ using the SFML media library.","fork":false,"url":"https://api.github.com/repos/jean553/Memoris","forks_url":"https://api.github.com/repos/jean553/Memoris/forks","keys_url":"https://api.github.com/repos/jean553/Memoris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jean553/Memoris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jean553/Memoris/teams","hooks_url":"https://api.github.com/repos/jean553/Memoris/hooks","issue_events_url":"https://api.github.com/repos/jean553/Memoris/issues/events{/number}","events_url":"https://api.github.com/repos/jean553/Memoris/events","assignees_url":"https://api.github.com/repos/jean553/Memoris/assignees{/user}","branches_url":"https://api.github.com/repos/jean553/Memoris/branches{/branch}","tags_url":"https://api.github.com/repos/jean553/Memoris/tags","blobs_url":"https://api.github.com/repos/jean553/Memoris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jean553/Memoris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jean553/Memoris/git/refs{/sha}","trees_url":"https://api.github.com/repos/jean553/Memoris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jean553/Memoris/statuses/{sha}","languages_url":"https://api.github.com/repos/jean553/Memoris/languages","stargazers_url":"https://api.github.com/repos/jean553/Memoris/stargazers","contributors_url":"https://api.github.com/repos/jean553/Memoris/contributors","subscribers_url":"https://api.github.com/repos/jean553/Memoris/subscribers","subscription_url":"https://api.github.com/repos/jean553/Memoris/subscription","commits_url":"https://api.github.com/repos/jean553/Memoris/commits{/sha}","git_commits_url":"https://api.github.com/repos/jean553/Memoris/git/commits{/sha}","comments_url":"https://api.github.com/repos/jean553/Memoris/comments{/number}","issue_comment_url":"https://api.github.com/repos/jean553/Memoris/issues/comments{/number}","contents_url":"https://api.github.com/repos/jean553/Memoris/contents/{+path}","compare_url":"https://api.github.com/repos/jean553/Memoris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jean553/Memoris/merges","archive_url":"https://api.github.com/repos/jean553/Memoris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jean553/Memoris/downloads","issues_url":"https://api.github.com/repos/jean553/Memoris/issues{/number}","pulls_url":"https://api.github.com/repos/jean553/Memoris/pulls{/number}","milestones_url":"https://api.github.com/repos/jean553/Memoris/milestones{/number}","notifications_url":"https://api.github.com/repos/jean553/Memoris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jean553/Memoris/labels{/name}","releases_url":"https://api.github.com/repos/jean553/Memoris/releases{/id}","deployments_url":"https://api.github.com/repos/jean553/Memoris/deployments","created_at":"2015-04-06T16:07:52Z","updated_at":"2016-01-15T13:58:50Z","pushed_at":"2016-02-18T16:12:30Z","git_url":"git://github.com/jean553/Memoris.git","ssh_url":"git@github.com:jean553/Memoris.git","clone_url":"https://github.com/jean553/Memoris.git","svn_url":"https://github.com/jean553/Memoris","homepage":"","size":21609,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jean553/Memoris/pulls/226"},"html":{"href":"https://github.com/jean553/Memoris/pull/226"},"issue":{"href":"https://api.github.com/repos/jean553/Memoris/issues/226"},"comments":{"href":"https://api.github.com/repos/jean553/Memoris/issues/226/comments"},"review_comments":{"href":"https://api.github.com/repos/jean553/Memoris/pulls/226/comments"},"review_comment":{"href":"https://api.github.com/repos/jean553/Memoris/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jean553/Memoris/pulls/226/commits"},"statuses":{"href":"https://api.github.com/repos/jean553/Memoris/statuses/16154fc13f3e1ce5c4a183c45265a6f9c38bea17"}}}}