{"action":"created","comment":{"url":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/comments/242021238","pull_request_review_id":185433778,"id":242021238,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjAyMTIzOA==","diff_hunk":"@@ -122,10 +126,27 @@ public Vector3 CoordToPosition(int x, int y)\n \n         for(int i = 0; i < piece.row; i++) {\n             for(int j = 0; j < piece.cols; j++) {\n-                if(piece.tiles[i,j] != null && this.tiles[i + x, j + y] == null) {\n-                    this.tiles[i + x, j + y] = piece.tiles[i, j];\n+                if(piece.tiles[i,j] != null && CheckPlaceTile(i + x, j + y)) {\n+                    PlaceTile(piece.tiles[i, j], i + x, j + y);\n                 }\n             }\n         }\n     }\n+\n+    public bool CheckPlaceTile(int x, int y)\n+    {\n+        return CheckCoord(x, y) && this.tiles[x, y].tileType == emptyTile.GetComponent<Tile>().tileType;\n+    }\n+\n+    public void PlaceTile(Tile tile, int x, int y)\n+    {\n+        tile.coordinate = new Vector2(x, y);\n+        tile.transform.position = CoordToPosition(x, y);\n+        tile.transform.parent = this.transform;\n+        if (this.tiles[x,y] != null)\n+        {\n+            Destroy(this.tiles[x, y].gameObject);\n+        }","path":"Assets/Scripts/Game/Board/Board.cs","position":80,"original_position":80,"commit_id":"d7fe15202e2be9fe85669574064feb55c5f73e76","original_commit_id":"a8084e34e86cf52ad0b3af1107817e59e76acc12","user":{"login":"leo-jh-li","id":22265039,"node_id":"MDQ6VXNlcjIyMjY1MDM5","avatar_url":"https://avatars2.githubusercontent.com/u/22265039?v=4","gravatar_id":"","url":"https://api.github.com/users/leo-jh-li","html_url":"https://github.com/leo-jh-li","followers_url":"https://api.github.com/users/leo-jh-li/followers","following_url":"https://api.github.com/users/leo-jh-li/following{/other_user}","gists_url":"https://api.github.com/users/leo-jh-li/gists{/gist_id}","starred_url":"https://api.github.com/users/leo-jh-li/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leo-jh-li/subscriptions","organizations_url":"https://api.github.com/users/leo-jh-li/orgs","repos_url":"https://api.github.com/users/leo-jh-li/repos","events_url":"https://api.github.com/users/leo-jh-li/events{/privacy}","received_events_url":"https://api.github.com/users/leo-jh-li/received_events","type":"User","site_admin":false},"body":"This implementation assumes the piece's tiles have already been instantiated by the piece placement interface (i.e. the piece already exists on the board as a \"preview\" when the player is moving it around and deciding where to put it).","created_at":"2018-12-17T04:04:26Z","updated_at":"2018-12-17T04:04:26Z","html_url":"https://github.com/BenjixD/ProjectCastle/pull/9#discussion_r242021238","pull_request_url":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/9","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/comments/242021238"},"html":{"href":"https://github.com/BenjixD/ProjectCastle/pull/9#discussion_r242021238"},"pull_request":{"href":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/9"}},"in_reply_to_id":242015644},"pull_request":{"url":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/9","id":234793229,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0NzkzMjI5","html_url":"https://github.com/BenjixD/ProjectCastle/pull/9","diff_url":"https://github.com/BenjixD/ProjectCastle/pull/9.diff","patch_url":"https://github.com/BenjixD/ProjectCastle/pull/9.patch","issue_url":"https://api.github.com/repos/BenjixD/ProjectCastle/issues/9","number":9,"state":"open","locked":false,"title":"Piece placement","user":{"login":"leo-jh-li","id":22265039,"node_id":"MDQ6VXNlcjIyMjY1MDM5","avatar_url":"https://avatars2.githubusercontent.com/u/22265039?v=4","gravatar_id":"","url":"https://api.github.com/users/leo-jh-li","html_url":"https://github.com/leo-jh-li","followers_url":"https://api.github.com/users/leo-jh-li/followers","following_url":"https://api.github.com/users/leo-jh-li/following{/other_user}","gists_url":"https://api.github.com/users/leo-jh-li/gists{/gist_id}","starred_url":"https://api.github.com/users/leo-jh-li/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leo-jh-li/subscriptions","organizations_url":"https://api.github.com/users/leo-jh-li/orgs","repos_url":"https://api.github.com/users/leo-jh-li/repos","events_url":"https://api.github.com/users/leo-jh-li/events{/privacy}","received_events_url":"https://api.github.com/users/leo-jh-li/received_events","type":"User","site_admin":false},"body":"* changed BaseTile to EmptyTile\r\n  * updated PlacePiece methods accordingly\r\n* implemented piece placement","created_at":"2018-11-29T21:32:15Z","updated_at":"2018-12-17T04:04:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0123c99cae13784177c65d75ffda2ed5becb0c98","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/9/commits","review_comments_url":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/9/comments","review_comment_url":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BenjixD/ProjectCastle/issues/9/comments","statuses_url":"https://api.github.com/repos/BenjixD/ProjectCastle/statuses/d7fe15202e2be9fe85669574064feb55c5f73e76","head":{"label":"BenjixD:piece-placement","ref":"piece-placement","sha":"d7fe15202e2be9fe85669574064feb55c5f73e76","user":{"login":"BenjixD","id":10258593,"node_id":"MDQ6VXNlcjEwMjU4NTkz","avatar_url":"https://avatars3.githubusercontent.com/u/10258593?v=4","gravatar_id":"","url":"https://api.github.com/users/BenjixD","html_url":"https://github.com/BenjixD","followers_url":"https://api.github.com/users/BenjixD/followers","following_url":"https://api.github.com/users/BenjixD/following{/other_user}","gists_url":"https://api.github.com/users/BenjixD/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjixD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjixD/subscriptions","organizations_url":"https://api.github.com/users/BenjixD/orgs","repos_url":"https://api.github.com/users/BenjixD/repos","events_url":"https://api.github.com/users/BenjixD/events{/privacy}","received_events_url":"https://api.github.com/users/BenjixD/received_events","type":"User","site_admin":false},"repo":{"id":157018383,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcwMTgzODM=","name":"ProjectCastle","full_name":"BenjixD/ProjectCastle","private":false,"owner":{"login":"BenjixD","id":10258593,"node_id":"MDQ6VXNlcjEwMjU4NTkz","avatar_url":"https://avatars3.githubusercontent.com/u/10258593?v=4","gravatar_id":"","url":"https://api.github.com/users/BenjixD","html_url":"https://github.com/BenjixD","followers_url":"https://api.github.com/users/BenjixD/followers","following_url":"https://api.github.com/users/BenjixD/following{/other_user}","gists_url":"https://api.github.com/users/BenjixD/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjixD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjixD/subscriptions","organizations_url":"https://api.github.com/users/BenjixD/orgs","repos_url":"https://api.github.com/users/BenjixD/repos","events_url":"https://api.github.com/users/BenjixD/events{/privacy}","received_events_url":"https://api.github.com/users/BenjixD/received_events","type":"User","site_admin":false},"html_url":"https://github.com/BenjixD/ProjectCastle","description":"CastleGame","fork":false,"url":"https://api.github.com/repos/BenjixD/ProjectCastle","forks_url":"https://api.github.com/repos/BenjixD/ProjectCastle/forks","keys_url":"https://api.github.com/repos/BenjixD/ProjectCastle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BenjixD/ProjectCastle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BenjixD/ProjectCastle/teams","hooks_url":"https://api.github.com/repos/BenjixD/ProjectCastle/hooks","issue_events_url":"https://api.github.com/repos/BenjixD/ProjectCastle/issues/events{/number}","events_url":"https://api.github.com/repos/BenjixD/ProjectCastle/events","assignees_url":"https://api.github.com/repos/BenjixD/ProjectCastle/assignees{/user}","branches_url":"https://api.github.com/repos/BenjixD/ProjectCastle/branches{/branch}","tags_url":"https://api.github.com/repos/BenjixD/ProjectCastle/tags","blobs_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/refs{/sha}","trees_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BenjixD/ProjectCastle/statuses/{sha}","languages_url":"https://api.github.com/repos/BenjixD/ProjectCastle/languages","stargazers_url":"https://api.github.com/repos/BenjixD/ProjectCastle/stargazers","contributors_url":"https://api.github.com/repos/BenjixD/ProjectCastle/contributors","subscribers_url":"https://api.github.com/repos/BenjixD/ProjectCastle/subscribers","subscription_url":"https://api.github.com/repos/BenjixD/ProjectCastle/subscription","commits_url":"https://api.github.com/repos/BenjixD/ProjectCastle/commits{/sha}","git_commits_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/commits{/sha}","comments_url":"https://api.github.com/repos/BenjixD/ProjectCastle/comments{/number}","issue_comment_url":"https://api.github.com/repos/BenjixD/ProjectCastle/issues/comments{/number}","contents_url":"https://api.github.com/repos/BenjixD/ProjectCastle/contents/{+path}","compare_url":"https://api.github.com/repos/BenjixD/ProjectCastle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BenjixD/ProjectCastle/merges","archive_url":"https://api.github.com/repos/BenjixD/ProjectCastle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BenjixD/ProjectCastle/downloads","issues_url":"https://api.github.com/repos/BenjixD/ProjectCastle/issues{/number}","pulls_url":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls{/number}","milestones_url":"https://api.github.com/repos/BenjixD/ProjectCastle/milestones{/number}","notifications_url":"https://api.github.com/repos/BenjixD/ProjectCastle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BenjixD/ProjectCastle/labels{/name}","releases_url":"https://api.github.com/repos/BenjixD/ProjectCastle/releases{/id}","deployments_url":"https://api.github.com/repos/BenjixD/ProjectCastle/deployments","created_at":"2018-11-10T20:23:26Z","updated_at":"2018-11-29T05:06:22Z","pushed_at":"2018-12-17T03:54:48Z","git_url":"git://github.com/BenjixD/ProjectCastle.git","ssh_url":"git@github.com:BenjixD/ProjectCastle.git","clone_url":"https://github.com/BenjixD/ProjectCastle.git","svn_url":"https://github.com/BenjixD/ProjectCastle","homepage":null,"size":899,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"BenjixD:master","ref":"master","sha":"6716269893c61a72be10639a44f59779321b29ce","user":{"login":"BenjixD","id":10258593,"node_id":"MDQ6VXNlcjEwMjU4NTkz","avatar_url":"https://avatars3.githubusercontent.com/u/10258593?v=4","gravatar_id":"","url":"https://api.github.com/users/BenjixD","html_url":"https://github.com/BenjixD","followers_url":"https://api.github.com/users/BenjixD/followers","following_url":"https://api.github.com/users/BenjixD/following{/other_user}","gists_url":"https://api.github.com/users/BenjixD/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjixD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjixD/subscriptions","organizations_url":"https://api.github.com/users/BenjixD/orgs","repos_url":"https://api.github.com/users/BenjixD/repos","events_url":"https://api.github.com/users/BenjixD/events{/privacy}","received_events_url":"https://api.github.com/users/BenjixD/received_events","type":"User","site_admin":false},"repo":{"id":157018383,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcwMTgzODM=","name":"ProjectCastle","full_name":"BenjixD/ProjectCastle","private":false,"owner":{"login":"BenjixD","id":10258593,"node_id":"MDQ6VXNlcjEwMjU4NTkz","avatar_url":"https://avatars3.githubusercontent.com/u/10258593?v=4","gravatar_id":"","url":"https://api.github.com/users/BenjixD","html_url":"https://github.com/BenjixD","followers_url":"https://api.github.com/users/BenjixD/followers","following_url":"https://api.github.com/users/BenjixD/following{/other_user}","gists_url":"https://api.github.com/users/BenjixD/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjixD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjixD/subscriptions","organizations_url":"https://api.github.com/users/BenjixD/orgs","repos_url":"https://api.github.com/users/BenjixD/repos","events_url":"https://api.github.com/users/BenjixD/events{/privacy}","received_events_url":"https://api.github.com/users/BenjixD/received_events","type":"User","site_admin":false},"html_url":"https://github.com/BenjixD/ProjectCastle","description":"CastleGame","fork":false,"url":"https://api.github.com/repos/BenjixD/ProjectCastle","forks_url":"https://api.github.com/repos/BenjixD/ProjectCastle/forks","keys_url":"https://api.github.com/repos/BenjixD/ProjectCastle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BenjixD/ProjectCastle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BenjixD/ProjectCastle/teams","hooks_url":"https://api.github.com/repos/BenjixD/ProjectCastle/hooks","issue_events_url":"https://api.github.com/repos/BenjixD/ProjectCastle/issues/events{/number}","events_url":"https://api.github.com/repos/BenjixD/ProjectCastle/events","assignees_url":"https://api.github.com/repos/BenjixD/ProjectCastle/assignees{/user}","branches_url":"https://api.github.com/repos/BenjixD/ProjectCastle/branches{/branch}","tags_url":"https://api.github.com/repos/BenjixD/ProjectCastle/tags","blobs_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/refs{/sha}","trees_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BenjixD/ProjectCastle/statuses/{sha}","languages_url":"https://api.github.com/repos/BenjixD/ProjectCastle/languages","stargazers_url":"https://api.github.com/repos/BenjixD/ProjectCastle/stargazers","contributors_url":"https://api.github.com/repos/BenjixD/ProjectCastle/contributors","subscribers_url":"https://api.github.com/repos/BenjixD/ProjectCastle/subscribers","subscription_url":"https://api.github.com/repos/BenjixD/ProjectCastle/subscription","commits_url":"https://api.github.com/repos/BenjixD/ProjectCastle/commits{/sha}","git_commits_url":"https://api.github.com/repos/BenjixD/ProjectCastle/git/commits{/sha}","comments_url":"https://api.github.com/repos/BenjixD/ProjectCastle/comments{/number}","issue_comment_url":"https://api.github.com/repos/BenjixD/ProjectCastle/issues/comments{/number}","contents_url":"https://api.github.com/repos/BenjixD/ProjectCastle/contents/{+path}","compare_url":"https://api.github.com/repos/BenjixD/ProjectCastle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BenjixD/ProjectCastle/merges","archive_url":"https://api.github.com/repos/BenjixD/ProjectCastle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BenjixD/ProjectCastle/downloads","issues_url":"https://api.github.com/repos/BenjixD/ProjectCastle/issues{/number}","pulls_url":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls{/number}","milestones_url":"https://api.github.com/repos/BenjixD/ProjectCastle/milestones{/number}","notifications_url":"https://api.github.com/repos/BenjixD/ProjectCastle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BenjixD/ProjectCastle/labels{/name}","releases_url":"https://api.github.com/repos/BenjixD/ProjectCastle/releases{/id}","deployments_url":"https://api.github.com/repos/BenjixD/ProjectCastle/deployments","created_at":"2018-11-10T20:23:26Z","updated_at":"2018-11-29T05:06:22Z","pushed_at":"2018-12-17T03:54:48Z","git_url":"git://github.com/BenjixD/ProjectCastle.git","ssh_url":"git@github.com:BenjixD/ProjectCastle.git","clone_url":"https://github.com/BenjixD/ProjectCastle.git","svn_url":"https://github.com/BenjixD/ProjectCastle","homepage":null,"size":899,"stargazers_count":0,"watchers_count":0,"language":"HTML","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/BenjixD/ProjectCastle/pulls/9"},"html":{"href":"https://github.com/BenjixD/ProjectCastle/pull/9"},"issue":{"href":"https://api.github.com/repos/BenjixD/ProjectCastle/issues/9"},"comments":{"href":"https://api.github.com/repos/BenjixD/ProjectCastle/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BenjixD/ProjectCastle/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/BenjixD/ProjectCastle/statuses/d7fe15202e2be9fe85669574064feb55c5f73e76"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"leo-jh-li"}}