{"action":"created","comment":{"url":"https://api.github.com/repos/Oplia512/Battleships/pulls/comments/130849083","pull_request_review_id":53767293,"id":130849083,"diff_hunk":"@@ -22,30 +24,33 @@ public PlayerActionState(Players currentPlayer){\n     }\n     @Override\n     public void display(Consumer<MessageObject> displayConsumer) {\n-        displayConsumer.accept(new MessageObject(Players.FIRST_PLAYER, \"SHOT\"));\n-        displayConsumer.accept(new MessageObject(Players.SECOND_PLAYER, \"WAIT\"));\n-    }\n+    \tdisplayConsumer.accept(new MessageObject(currentPlayer, MessageCreator.createJsonMessageByKey(\"your.turn\")));\n+        displayConsumer.accept(new MessageObject(currentPlayer.getOpponent(), MessageCreator.createJsonMessageByKey(\"not.your.turn\")));\n+   }\n \n     @Override\n     public GameState changeState(String inputMessage) {\n+    \tMarkedIndexes markedIndexes;\n \n         if (currentPlayer.getPlayer().canUseNuke() && inputMessage.startsWith(\"n\")) {\n-            //markedIndexes = dropNuke(inputMessage.replace(\"n\", \"\"));\n-            Integer index = Integer.parseInt(inputMessage);\n-            Attack attack = new NukeAttack(currentPlayer.getOpponent().getPlayer().getBoard());\n-            attack.attack(index);\n+            markedIndexes = dropNuke(inputMessage.replace(\"n\", \"\"));\n         } else {\n-            //markedIndexes = shootOnField(inputMessage);\n-            Integer index = Integer.parseInt(inputMessage);\n-            Attack attack = new NormalAttack(currentPlayer.getOpponent().getPlayer().getBoard());\n-            attack.attack(index);\n+            markedIndexes = shootOnField(inputMessage);\n         }\n \n-        return new PlayerEndActionState(currentPlayer);\n+        return new PlayerEndActionState(currentPlayer, markedIndexes);\n+    }\n+    \n+    private MarkedIndexes dropNuke(String inputMessage) {\n+    \tInteger index = Integer.parseInt(inputMessage);\n+    \tAttack attack = new NukeAttack(currentPlayer.getOpponent().getPlayer().getBoard());\n+    \treturn attack.attack(index);\n     }\n+    \n+    private MarkedIndexes shootOnField(String inputMessage) {\n+    \tInteger index = Integer.parseInt(inputMessage);\n+    \tAttack attack = new NormalAttack(currentPlayer.getOpponent().getPlayer().getBoard() );","path":"src/main/java/com/java_academy/logic/state_machine/PlayerActionState.java","position":50,"original_position":50,"commit_id":"f1e28d181a3da15194e78530ef8f312f209d109e","original_commit_id":"f1e28d181a3da15194e78530ef8f312f209d109e","user":{"login":"mprtcz","id":17063143,"avatar_url":"https://avatars3.githubusercontent.com/u/17063143?v=4","gravatar_id":"","url":"https://api.github.com/users/mprtcz","html_url":"https://github.com/mprtcz","followers_url":"https://api.github.com/users/mprtcz/followers","following_url":"https://api.github.com/users/mprtcz/following{/other_user}","gists_url":"https://api.github.com/users/mprtcz/gists{/gist_id}","starred_url":"https://api.github.com/users/mprtcz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprtcz/subscriptions","organizations_url":"https://api.github.com/users/mprtcz/orgs","repos_url":"https://api.github.com/users/mprtcz/repos","events_url":"https://api.github.com/users/mprtcz/events{/privacy}","received_events_url":"https://api.github.com/users/mprtcz/received_events","type":"User","site_admin":false},"body":"Ugly chained getters, come on","created_at":"2017-08-02T11:22:20Z","updated_at":"2017-08-02T11:34:00Z","html_url":"https://github.com/Oplia512/Battleships/pull/23#discussion_r130849083","pull_request_url":"https://api.github.com/repos/Oplia512/Battleships/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/Oplia512/Battleships/pulls/comments/130849083"},"html":{"href":"https://github.com/Oplia512/Battleships/pull/23#discussion_r130849083"},"pull_request":{"href":"https://api.github.com/repos/Oplia512/Battleships/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/Oplia512/Battleships/pulls/23","id":133640705,"html_url":"https://github.com/Oplia512/Battleships/pull/23","diff_url":"https://github.com/Oplia512/Battleships/pull/23.diff","patch_url":"https://github.com/Oplia512/Battleships/pull/23.patch","issue_url":"https://api.github.com/repos/Oplia512/Battleships/issues/23","number":23,"state":"open","locked":false,"title":"Logic feature","user":{"login":"arturAR","id":18446697,"avatar_url":"https://avatars1.githubusercontent.com/u/18446697?v=4","gravatar_id":"","url":"https://api.github.com/users/arturAR","html_url":"https://github.com/arturAR","followers_url":"https://api.github.com/users/arturAR/followers","following_url":"https://api.github.com/users/arturAR/following{/other_user}","gists_url":"https://api.github.com/users/arturAR/gists{/gist_id}","starred_url":"https://api.github.com/users/arturAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arturAR/subscriptions","organizations_url":"https://api.github.com/users/arturAR/orgs","repos_url":"https://api.github.com/users/arturAR/repos","events_url":"https://api.github.com/users/arturAR/events{/privacy}","received_events_url":"https://api.github.com/users/arturAR/received_events","type":"User","site_admin":false},"body":"Implementing messages in the state machine. ","created_at":"2017-08-02T07:33:28Z","updated_at":"2017-08-02T11:34:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87349efe10a79dd62c22dcefe0f553ccafb7ab74","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Devas","id":9119159,"avatar_url":"https://avatars2.githubusercontent.com/u/9119159?v=4","gravatar_id":"","url":"https://api.github.com/users/Devas","html_url":"https://github.com/Devas","followers_url":"https://api.github.com/users/Devas/followers","following_url":"https://api.github.com/users/Devas/following{/other_user}","gists_url":"https://api.github.com/users/Devas/gists{/gist_id}","starred_url":"https://api.github.com/users/Devas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Devas/subscriptions","organizations_url":"https://api.github.com/users/Devas/orgs","repos_url":"https://api.github.com/users/Devas/repos","events_url":"https://api.github.com/users/Devas/events{/privacy}","received_events_url":"https://api.github.com/users/Devas/received_events","type":"User","site_admin":false},{"login":"Ice94","id":11706108,"avatar_url":"https://avatars0.githubusercontent.com/u/11706108?v=4","gravatar_id":"","url":"https://api.github.com/users/Ice94","html_url":"https://github.com/Ice94","followers_url":"https://api.github.com/users/Ice94/followers","following_url":"https://api.github.com/users/Ice94/following{/other_user}","gists_url":"https://api.github.com/users/Ice94/gists{/gist_id}","starred_url":"https://api.github.com/users/Ice94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ice94/subscriptions","organizations_url":"https://api.github.com/users/Ice94/orgs","repos_url":"https://api.github.com/users/Ice94/repos","events_url":"https://api.github.com/users/Ice94/events{/privacy}","received_events_url":"https://api.github.com/users/Ice94/received_events","type":"User","site_admin":false},{"login":"pawlusha","id":14939017,"avatar_url":"https://avatars0.githubusercontent.com/u/14939017?v=4","gravatar_id":"","url":"https://api.github.com/users/pawlusha","html_url":"https://github.com/pawlusha","followers_url":"https://api.github.com/users/pawlusha/followers","following_url":"https://api.github.com/users/pawlusha/following{/other_user}","gists_url":"https://api.github.com/users/pawlusha/gists{/gist_id}","starred_url":"https://api.github.com/users/pawlusha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pawlusha/subscriptions","organizations_url":"https://api.github.com/users/pawlusha/orgs","repos_url":"https://api.github.com/users/pawlusha/repos","events_url":"https://api.github.com/users/pawlusha/events{/privacy}","received_events_url":"https://api.github.com/users/pawlusha/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Oplia512/Battleships/pulls/23/commits","review_comments_url":"https://api.github.com/repos/Oplia512/Battleships/pulls/23/comments","review_comment_url":"https://api.github.com/repos/Oplia512/Battleships/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Oplia512/Battleships/issues/23/comments","statuses_url":"https://api.github.com/repos/Oplia512/Battleships/statuses/f1e28d181a3da15194e78530ef8f312f209d109e","head":{"label":"Oplia512:logic_feature","ref":"logic_feature","sha":"f1e28d181a3da15194e78530ef8f312f209d109e","user":{"login":"Oplia512","id":5834098,"avatar_url":"https://avatars3.githubusercontent.com/u/5834098?v=4","gravatar_id":"","url":"https://api.github.com/users/Oplia512","html_url":"https://github.com/Oplia512","followers_url":"https://api.github.com/users/Oplia512/followers","following_url":"https://api.github.com/users/Oplia512/following{/other_user}","gists_url":"https://api.github.com/users/Oplia512/gists{/gist_id}","starred_url":"https://api.github.com/users/Oplia512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oplia512/subscriptions","organizations_url":"https://api.github.com/users/Oplia512/orgs","repos_url":"https://api.github.com/users/Oplia512/repos","events_url":"https://api.github.com/users/Oplia512/events{/privacy}","received_events_url":"https://api.github.com/users/Oplia512/received_events","type":"User","site_admin":false},"repo":{"id":98280990,"name":"Battleships","full_name":"Oplia512/Battleships","owner":{"login":"Oplia512","id":5834098,"avatar_url":"https://avatars3.githubusercontent.com/u/5834098?v=4","gravatar_id":"","url":"https://api.github.com/users/Oplia512","html_url":"https://github.com/Oplia512","followers_url":"https://api.github.com/users/Oplia512/followers","following_url":"https://api.github.com/users/Oplia512/following{/other_user}","gists_url":"https://api.github.com/users/Oplia512/gists{/gist_id}","starred_url":"https://api.github.com/users/Oplia512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oplia512/subscriptions","organizations_url":"https://api.github.com/users/Oplia512/orgs","repos_url":"https://api.github.com/users/Oplia512/repos","events_url":"https://api.github.com/users/Oplia512/events{/privacy}","received_events_url":"https://api.github.com/users/Oplia512/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Oplia512/Battleships","description":"Battleships","fork":false,"url":"https://api.github.com/repos/Oplia512/Battleships","forks_url":"https://api.github.com/repos/Oplia512/Battleships/forks","keys_url":"https://api.github.com/repos/Oplia512/Battleships/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Oplia512/Battleships/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Oplia512/Battleships/teams","hooks_url":"https://api.github.com/repos/Oplia512/Battleships/hooks","issue_events_url":"https://api.github.com/repos/Oplia512/Battleships/issues/events{/number}","events_url":"https://api.github.com/repos/Oplia512/Battleships/events","assignees_url":"https://api.github.com/repos/Oplia512/Battleships/assignees{/user}","branches_url":"https://api.github.com/repos/Oplia512/Battleships/branches{/branch}","tags_url":"https://api.github.com/repos/Oplia512/Battleships/tags","blobs_url":"https://api.github.com/repos/Oplia512/Battleships/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Oplia512/Battleships/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Oplia512/Battleships/git/refs{/sha}","trees_url":"https://api.github.com/repos/Oplia512/Battleships/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Oplia512/Battleships/statuses/{sha}","languages_url":"https://api.github.com/repos/Oplia512/Battleships/languages","stargazers_url":"https://api.github.com/repos/Oplia512/Battleships/stargazers","contributors_url":"https://api.github.com/repos/Oplia512/Battleships/contributors","subscribers_url":"https://api.github.com/repos/Oplia512/Battleships/subscribers","subscription_url":"https://api.github.com/repos/Oplia512/Battleships/subscription","commits_url":"https://api.github.com/repos/Oplia512/Battleships/commits{/sha}","git_commits_url":"https://api.github.com/repos/Oplia512/Battleships/git/commits{/sha}","comments_url":"https://api.github.com/repos/Oplia512/Battleships/comments{/number}","issue_comment_url":"https://api.github.com/repos/Oplia512/Battleships/issues/comments{/number}","contents_url":"https://api.github.com/repos/Oplia512/Battleships/contents/{+path}","compare_url":"https://api.github.com/repos/Oplia512/Battleships/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Oplia512/Battleships/merges","archive_url":"https://api.github.com/repos/Oplia512/Battleships/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Oplia512/Battleships/downloads","issues_url":"https://api.github.com/repos/Oplia512/Battleships/issues{/number}","pulls_url":"https://api.github.com/repos/Oplia512/Battleships/pulls{/number}","milestones_url":"https://api.github.com/repos/Oplia512/Battleships/milestones{/number}","notifications_url":"https://api.github.com/repos/Oplia512/Battleships/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Oplia512/Battleships/labels{/name}","releases_url":"https://api.github.com/repos/Oplia512/Battleships/releases{/id}","deployments_url":"https://api.github.com/repos/Oplia512/Battleships/deployments","created_at":"2017-07-25T08:04:58Z","updated_at":"2017-07-25T11:19:48Z","pushed_at":"2017-08-02T09:42:12Z","git_url":"git://github.com/Oplia512/Battleships.git","ssh_url":"git@github.com:Oplia512/Battleships.git","clone_url":"https://github.com/Oplia512/Battleships.git","svn_url":"https://github.com/Oplia512/Battleships","homepage":null,"size":164,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Oplia512:master","ref":"master","sha":"9a56e94d94f8abefbcfd0a96867fca0a8c9bd24c","user":{"login":"Oplia512","id":5834098,"avatar_url":"https://avatars3.githubusercontent.com/u/5834098?v=4","gravatar_id":"","url":"https://api.github.com/users/Oplia512","html_url":"https://github.com/Oplia512","followers_url":"https://api.github.com/users/Oplia512/followers","following_url":"https://api.github.com/users/Oplia512/following{/other_user}","gists_url":"https://api.github.com/users/Oplia512/gists{/gist_id}","starred_url":"https://api.github.com/users/Oplia512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oplia512/subscriptions","organizations_url":"https://api.github.com/users/Oplia512/orgs","repos_url":"https://api.github.com/users/Oplia512/repos","events_url":"https://api.github.com/users/Oplia512/events{/privacy}","received_events_url":"https://api.github.com/users/Oplia512/received_events","type":"User","site_admin":false},"repo":{"id":98280990,"name":"Battleships","full_name":"Oplia512/Battleships","owner":{"login":"Oplia512","id":5834098,"avatar_url":"https://avatars3.githubusercontent.com/u/5834098?v=4","gravatar_id":"","url":"https://api.github.com/users/Oplia512","html_url":"https://github.com/Oplia512","followers_url":"https://api.github.com/users/Oplia512/followers","following_url":"https://api.github.com/users/Oplia512/following{/other_user}","gists_url":"https://api.github.com/users/Oplia512/gists{/gist_id}","starred_url":"https://api.github.com/users/Oplia512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oplia512/subscriptions","organizations_url":"https://api.github.com/users/Oplia512/orgs","repos_url":"https://api.github.com/users/Oplia512/repos","events_url":"https://api.github.com/users/Oplia512/events{/privacy}","received_events_url":"https://api.github.com/users/Oplia512/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Oplia512/Battleships","description":"Battleships","fork":false,"url":"https://api.github.com/repos/Oplia512/Battleships","forks_url":"https://api.github.com/repos/Oplia512/Battleships/forks","keys_url":"https://api.github.com/repos/Oplia512/Battleships/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Oplia512/Battleships/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Oplia512/Battleships/teams","hooks_url":"https://api.github.com/repos/Oplia512/Battleships/hooks","issue_events_url":"https://api.github.com/repos/Oplia512/Battleships/issues/events{/number}","events_url":"https://api.github.com/repos/Oplia512/Battleships/events","assignees_url":"https://api.github.com/repos/Oplia512/Battleships/assignees{/user}","branches_url":"https://api.github.com/repos/Oplia512/Battleships/branches{/branch}","tags_url":"https://api.github.com/repos/Oplia512/Battleships/tags","blobs_url":"https://api.github.com/repos/Oplia512/Battleships/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Oplia512/Battleships/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Oplia512/Battleships/git/refs{/sha}","trees_url":"https://api.github.com/repos/Oplia512/Battleships/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Oplia512/Battleships/statuses/{sha}","languages_url":"https://api.github.com/repos/Oplia512/Battleships/languages","stargazers_url":"https://api.github.com/repos/Oplia512/Battleships/stargazers","contributors_url":"https://api.github.com/repos/Oplia512/Battleships/contributors","subscribers_url":"https://api.github.com/repos/Oplia512/Battleships/subscribers","subscription_url":"https://api.github.com/repos/Oplia512/Battleships/subscription","commits_url":"https://api.github.com/repos/Oplia512/Battleships/commits{/sha}","git_commits_url":"https://api.github.com/repos/Oplia512/Battleships/git/commits{/sha}","comments_url":"https://api.github.com/repos/Oplia512/Battleships/comments{/number}","issue_comment_url":"https://api.github.com/repos/Oplia512/Battleships/issues/comments{/number}","contents_url":"https://api.github.com/repos/Oplia512/Battleships/contents/{+path}","compare_url":"https://api.github.com/repos/Oplia512/Battleships/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Oplia512/Battleships/merges","archive_url":"https://api.github.com/repos/Oplia512/Battleships/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Oplia512/Battleships/downloads","issues_url":"https://api.github.com/repos/Oplia512/Battleships/issues{/number}","pulls_url":"https://api.github.com/repos/Oplia512/Battleships/pulls{/number}","milestones_url":"https://api.github.com/repos/Oplia512/Battleships/milestones{/number}","notifications_url":"https://api.github.com/repos/Oplia512/Battleships/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Oplia512/Battleships/labels{/name}","releases_url":"https://api.github.com/repos/Oplia512/Battleships/releases{/id}","deployments_url":"https://api.github.com/repos/Oplia512/Battleships/deployments","created_at":"2017-07-25T08:04:58Z","updated_at":"2017-07-25T11:19:48Z","pushed_at":"2017-08-02T09:42:12Z","git_url":"git://github.com/Oplia512/Battleships.git","ssh_url":"git@github.com:Oplia512/Battleships.git","clone_url":"https://github.com/Oplia512/Battleships.git","svn_url":"https://github.com/Oplia512/Battleships","homepage":null,"size":164,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Oplia512/Battleships/pulls/23"},"html":{"href":"https://github.com/Oplia512/Battleships/pull/23"},"issue":{"href":"https://api.github.com/repos/Oplia512/Battleships/issues/23"},"comments":{"href":"https://api.github.com/repos/Oplia512/Battleships/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/Oplia512/Battleships/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/Oplia512/Battleships/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Oplia512/Battleships/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/Oplia512/Battleships/statuses/f1e28d181a3da15194e78530ef8f312f209d109e"}}}}
{"actor":{"display_login":"mprtcz"}}