{"action":"created","comment":{"url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/comments/206097772","pull_request_review_id":141487167,"id":206097772,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjA5Nzc3Mg==","diff_hunk":"@@ -17,11 +17,45 @@ public Ship(Set<BoardField> masts) {\n         return masts;\n     }\n \n-    public boolean isMastHit(Coordinate coordinate) {\n-        return masts.stream().anyMatch(m -> m.getCoordinate().equals(coordinate));\n+    boolean isMastHit(Coordinate coordinate) {\n+        Optional<BoardField> mastForCoordinate = getMastForCoordinate(coordinate);\n+        return mastForCoordinate.isPresent() ? mastForCoordinate.get().isHit() : false;\n     }\n \n-    public String toString(){\n+    private Optional<BoardField> getMastForCoordinate(Coordinate coordinate) {\n+        return masts.stream().filter(boardField -> boardField.getCoordinate().equals(coordinate))","path":"client/src/main/java/com/battleships/gamewindow/board/Ship.java","position":25,"original_position":25,"commit_id":"ee2a4cc78b7a5d78cb8b9da24544bf3bbc4f5515","original_commit_id":"ee2a4cc78b7a5d78cb8b9da24544bf3bbc4f5515","user":{"login":"RafalJDev","id":32623268,"node_id":"MDQ6VXNlcjMyNjIzMjY4","avatar_url":"https://avatars2.githubusercontent.com/u/32623268?v=4","gravatar_id":"","url":"https://api.github.com/users/RafalJDev","html_url":"https://github.com/RafalJDev","followers_url":"https://api.github.com/users/RafalJDev/followers","following_url":"https://api.github.com/users/RafalJDev/following{/other_user}","gists_url":"https://api.github.com/users/RafalJDev/gists{/gist_id}","starred_url":"https://api.github.com/users/RafalJDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RafalJDev/subscriptions","organizations_url":"https://api.github.com/users/RafalJDev/orgs","repos_url":"https://api.github.com/users/RafalJDev/repos","events_url":"https://api.github.com/users/RafalJDev/events{/privacy}","received_events_url":"https://api.github.com/users/RafalJDev/received_events","type":"User","site_admin":false},"body":"LoD (Demeter)","created_at":"2018-07-30T11:23:56Z","updated_at":"2018-07-30T11:43:01Z","html_url":"https://github.com/JavaAcademyDoktorki/battleships/pull/45#discussion_r206097772","pull_request_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/45","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/comments/206097772"},"html":{"href":"https://github.com/JavaAcademyDoktorki/battleships/pull/45#discussion_r206097772"},"pull_request":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/45","id":204732126,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NzMyMTI2","html_url":"https://github.com/JavaAcademyDoktorki/battleships/pull/45","diff_url":"https://github.com/JavaAcademyDoktorki/battleships/pull/45.diff","patch_url":"https://github.com/JavaAcademyDoktorki/battleships/pull/45.patch","issue_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues/45","number":45,"state":"open","locked":false,"title":"Merge branch","user":{"login":"KrzysztofDzioba","id":23156969,"node_id":"MDQ6VXNlcjIzMTU2OTY5","avatar_url":"https://avatars3.githubusercontent.com/u/23156969?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofDzioba","html_url":"https://github.com/KrzysztofDzioba","followers_url":"https://api.github.com/users/KrzysztofDzioba/followers","following_url":"https://api.github.com/users/KrzysztofDzioba/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofDzioba/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofDzioba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofDzioba/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofDzioba/orgs","repos_url":"https://api.github.com/users/KrzysztofDzioba/repos","events_url":"https://api.github.com/users/KrzysztofDzioba/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofDzioba/received_events","type":"User","site_admin":false},"body":"playable game! :)\r\ndisabling buttons already hit\r\nshooting almost OK, buffer sending to correct\r\nimplements HIT message\r\nMerge remote-tracking branch 'remotes/origin/fleet_implementation2' into end_game\r\nSending command that other player won\r\nPrimitive win alert on button click\r\nfleet isSunk method implemented and tested\r\nMerge branch 'fleet_implementation2' of github.com:JavaAcademyDoktorki/battleships into end_game\r\nship hit method deimplemented, ship isSunk method tested\r\nship hit implemented","created_at":"2018-07-30T08:39:37Z","updated_at":"2018-07-30T11:43:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"946dcd9c03c518fa1cce195f1d59bf478826cddf","assignee":null,"assignees":[],"requested_reviewers":[{"login":"AdrianHarenczyk","id":38125398,"node_id":"MDQ6VXNlcjM4MTI1Mzk4","avatar_url":"https://avatars1.githubusercontent.com/u/38125398?v=4","gravatar_id":"","url":"https://api.github.com/users/AdrianHarenczyk","html_url":"https://github.com/AdrianHarenczyk","followers_url":"https://api.github.com/users/AdrianHarenczyk/followers","following_url":"https://api.github.com/users/AdrianHarenczyk/following{/other_user}","gists_url":"https://api.github.com/users/AdrianHarenczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/AdrianHarenczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdrianHarenczyk/subscriptions","organizations_url":"https://api.github.com/users/AdrianHarenczyk/orgs","repos_url":"https://api.github.com/users/AdrianHarenczyk/repos","events_url":"https://api.github.com/users/AdrianHarenczyk/events{/privacy}","received_events_url":"https://api.github.com/users/AdrianHarenczyk/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/45/commits","review_comments_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/45/comments","review_comment_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues/45/comments","statuses_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/statuses/ee2a4cc78b7a5d78cb8b9da24544bf3bbc4f5515","head":{"label":"JavaAcademyDoktorki:merge_branch","ref":"merge_branch","sha":"ee2a4cc78b7a5d78cb8b9da24544bf3bbc4f5515","user":{"login":"JavaAcademyDoktorki","id":40495099,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDk1MDk5","avatar_url":"https://avatars3.githubusercontent.com/u/40495099?v=4","gravatar_id":"","url":"https://api.github.com/users/JavaAcademyDoktorki","html_url":"https://github.com/JavaAcademyDoktorki","followers_url":"https://api.github.com/users/JavaAcademyDoktorki/followers","following_url":"https://api.github.com/users/JavaAcademyDoktorki/following{/other_user}","gists_url":"https://api.github.com/users/JavaAcademyDoktorki/gists{/gist_id}","starred_url":"https://api.github.com/users/JavaAcademyDoktorki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JavaAcademyDoktorki/subscriptions","organizations_url":"https://api.github.com/users/JavaAcademyDoktorki/orgs","repos_url":"https://api.github.com/users/JavaAcademyDoktorki/repos","events_url":"https://api.github.com/users/JavaAcademyDoktorki/events{/privacy}","received_events_url":"https://api.github.com/users/JavaAcademyDoktorki/received_events","type":"Organization","site_admin":false},"repo":{"id":139009080,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwMDkwODA=","name":"battleships","full_name":"JavaAcademyDoktorki/battleships","owner":{"login":"JavaAcademyDoktorki","id":40495099,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDk1MDk5","avatar_url":"https://avatars3.githubusercontent.com/u/40495099?v=4","gravatar_id":"","url":"https://api.github.com/users/JavaAcademyDoktorki","html_url":"https://github.com/JavaAcademyDoktorki","followers_url":"https://api.github.com/users/JavaAcademyDoktorki/followers","following_url":"https://api.github.com/users/JavaAcademyDoktorki/following{/other_user}","gists_url":"https://api.github.com/users/JavaAcademyDoktorki/gists{/gist_id}","starred_url":"https://api.github.com/users/JavaAcademyDoktorki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JavaAcademyDoktorki/subscriptions","organizations_url":"https://api.github.com/users/JavaAcademyDoktorki/orgs","repos_url":"https://api.github.com/users/JavaAcademyDoktorki/repos","events_url":"https://api.github.com/users/JavaAcademyDoktorki/events{/privacy}","received_events_url":"https://api.github.com/users/JavaAcademyDoktorki/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JavaAcademyDoktorki/battleships","description":null,"fork":false,"url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships","forks_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/forks","keys_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/teams","hooks_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/hooks","issue_events_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues/events{/number}","events_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/events","assignees_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/assignees{/user}","branches_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/branches{/branch}","tags_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/tags","blobs_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/refs{/sha}","trees_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/statuses/{sha}","languages_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/languages","stargazers_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/stargazers","contributors_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/contributors","subscribers_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/subscribers","subscription_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/subscription","commits_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/commits{/sha}","git_commits_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/commits{/sha}","comments_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/comments{/number}","issue_comment_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues/comments{/number}","contents_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/contents/{+path}","compare_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/merges","archive_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/downloads","issues_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues{/number}","pulls_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls{/number}","milestones_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/milestones{/number}","notifications_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/labels{/name}","releases_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/releases{/id}","deployments_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/deployments","created_at":"2018-06-28T11:28:08Z","updated_at":"2018-07-27T10:42:14Z","pushed_at":"2018-07-30T11:38:42Z","git_url":"git://github.com/JavaAcademyDoktorki/battleships.git","ssh_url":"git@github.com:JavaAcademyDoktorki/battleships.git","clone_url":"https://github.com/JavaAcademyDoktorki/battleships.git","svn_url":"https://github.com/JavaAcademyDoktorki/battleships","homepage":null,"size":865,"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,"archived":false,"open_issues_count":21,"license":null,"forks":0,"open_issues":21,"watchers":0,"default_branch":"master"}},"base":{"label":"JavaAcademyDoktorki:master","ref":"master","sha":"8f47928e2649daa4b1b8eca0761951b04a963fea","user":{"login":"JavaAcademyDoktorki","id":40495099,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDk1MDk5","avatar_url":"https://avatars3.githubusercontent.com/u/40495099?v=4","gravatar_id":"","url":"https://api.github.com/users/JavaAcademyDoktorki","html_url":"https://github.com/JavaAcademyDoktorki","followers_url":"https://api.github.com/users/JavaAcademyDoktorki/followers","following_url":"https://api.github.com/users/JavaAcademyDoktorki/following{/other_user}","gists_url":"https://api.github.com/users/JavaAcademyDoktorki/gists{/gist_id}","starred_url":"https://api.github.com/users/JavaAcademyDoktorki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JavaAcademyDoktorki/subscriptions","organizations_url":"https://api.github.com/users/JavaAcademyDoktorki/orgs","repos_url":"https://api.github.com/users/JavaAcademyDoktorki/repos","events_url":"https://api.github.com/users/JavaAcademyDoktorki/events{/privacy}","received_events_url":"https://api.github.com/users/JavaAcademyDoktorki/received_events","type":"Organization","site_admin":false},"repo":{"id":139009080,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwMDkwODA=","name":"battleships","full_name":"JavaAcademyDoktorki/battleships","owner":{"login":"JavaAcademyDoktorki","id":40495099,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDk1MDk5","avatar_url":"https://avatars3.githubusercontent.com/u/40495099?v=4","gravatar_id":"","url":"https://api.github.com/users/JavaAcademyDoktorki","html_url":"https://github.com/JavaAcademyDoktorki","followers_url":"https://api.github.com/users/JavaAcademyDoktorki/followers","following_url":"https://api.github.com/users/JavaAcademyDoktorki/following{/other_user}","gists_url":"https://api.github.com/users/JavaAcademyDoktorki/gists{/gist_id}","starred_url":"https://api.github.com/users/JavaAcademyDoktorki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JavaAcademyDoktorki/subscriptions","organizations_url":"https://api.github.com/users/JavaAcademyDoktorki/orgs","repos_url":"https://api.github.com/users/JavaAcademyDoktorki/repos","events_url":"https://api.github.com/users/JavaAcademyDoktorki/events{/privacy}","received_events_url":"https://api.github.com/users/JavaAcademyDoktorki/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JavaAcademyDoktorki/battleships","description":null,"fork":false,"url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships","forks_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/forks","keys_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/teams","hooks_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/hooks","issue_events_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues/events{/number}","events_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/events","assignees_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/assignees{/user}","branches_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/branches{/branch}","tags_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/tags","blobs_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/refs{/sha}","trees_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/statuses/{sha}","languages_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/languages","stargazers_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/stargazers","contributors_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/contributors","subscribers_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/subscribers","subscription_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/subscription","commits_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/commits{/sha}","git_commits_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/git/commits{/sha}","comments_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/comments{/number}","issue_comment_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues/comments{/number}","contents_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/contents/{+path}","compare_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/merges","archive_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/downloads","issues_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues{/number}","pulls_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls{/number}","milestones_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/milestones{/number}","notifications_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/labels{/name}","releases_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/releases{/id}","deployments_url":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/deployments","created_at":"2018-06-28T11:28:08Z","updated_at":"2018-07-27T10:42:14Z","pushed_at":"2018-07-30T11:38:42Z","git_url":"git://github.com/JavaAcademyDoktorki/battleships.git","ssh_url":"git@github.com:JavaAcademyDoktorki/battleships.git","clone_url":"https://github.com/JavaAcademyDoktorki/battleships.git","svn_url":"https://github.com/JavaAcademyDoktorki/battleships","homepage":null,"size":865,"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,"archived":false,"open_issues_count":21,"license":null,"forks":0,"open_issues":21,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/45"},"html":{"href":"https://github.com/JavaAcademyDoktorki/battleships/pull/45"},"issue":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues/45"},"comments":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/JavaAcademyDoktorki/battleships/statuses/ee2a4cc78b7a5d78cb8b9da24544bf3bbc4f5515"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"RafalJDev"}}