{"action":"created","issue":{"url":"https://api.github.com/repos/TeamStoic/StoicChess/issues/42","repository_url":"https://api.github.com/repos/TeamStoic/StoicChess","labels_url":"https://api.github.com/repos/TeamStoic/StoicChess/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/TeamStoic/StoicChess/issues/42/comments","events_url":"https://api.github.com/repos/TeamStoic/StoicChess/issues/42/events","html_url":"https://github.com/TeamStoic/StoicChess/pull/42","id":167457527,"number":42,"title":"Obstruction Logic + Integrated Capture Logic","user":{"login":"chadbaum","id":4358977,"avatar_url":"https://avatars.githubusercontent.com/u/4358977?v=3","gravatar_id":"","url":"https://api.github.com/users/chadbaum","html_url":"https://github.com/chadbaum","followers_url":"https://api.github.com/users/chadbaum/followers","following_url":"https://api.github.com/users/chadbaum/following{/other_user}","gists_url":"https://api.github.com/users/chadbaum/gists{/gist_id}","starred_url":"https://api.github.com/users/chadbaum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chadbaum/subscriptions","organizations_url":"https://api.github.com/users/chadbaum/orgs","repos_url":"https://api.github.com/users/chadbaum/repos","events_url":"https://api.github.com/users/chadbaum/events{/privacy}","received_events_url":"https://api.github.com/users/chadbaum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-25T20:27:38Z","updated_at":"2016-07-27T21:55:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/TeamStoic/StoicChess/pulls/42","html_url":"https://github.com/TeamStoic/StoicChess/pull/42","diff_url":"https://github.com/TeamStoic/StoicChess/pull/42.diff","patch_url":"https://github.com/TeamStoic/StoicChess/pull/42.patch"},"body":"Full obstruction logic for all pieces.\r\n\r\n- Obstruction logic checks the tiles between origin and destination and rejects a move that has a piece in the way.  This logic does not apply to King or Knight regular moves.  It will apply to King castling but that is not implemented yet.\r\n- Queen, rook, bishop, and the 2-forward-move of pawn all use the same logic in Piece.rb.  \r\n- Pawn has an extra method for determining that the tile it is moving to is not occupied since this is an edge case where pawn cannot capture this piece if it used a forward-move.   This will be integrated with capture logic later.\r\n- Move-set validation methods renamed to clear_?? to highlight that they now check for obstruction.  For example, `horizontal_move?(x, y)` is now `clear_horizontal_move?(x, y)`.  Note that these are all private helper methods and the only method that will be exposed to the front-end is `move!(x, y)` which will make this very easy to manage as we go forward.  Move will take care of everything.\r\n- All unit tests for move validation needed to be rewritten.  I used rspec let variables where possible to reduce the code-base in rspec by about 40%.  \r\n- Obstruction code was significantly refactored over time to be fully rubocop-compliant.\r\n\r\nTO BE DONE in a later PR:\r\n\r\n- Refactor database query technique for obstruction so that instead of making a query for each tile as its presented to the method, it takes the entire array of coordinates and queries ActiveRecord in one shot.\r\n- Refactor Rspecs to re-integrate/make better use of FactoryGirl objects.\r\n\r\n**I will have to do some significant refactoring to bring move, move validation, and obstruction logic together with Ethan's capture logic PR.  As a result, we will need to merge Ethan's code first, since its much smaller, and then I will handle the merge conflicts that result in this PR and then re-submit it.**"},"comment":{"url":"https://api.github.com/repos/TeamStoic/StoicChess/issues/comments/235733880","html_url":"https://github.com/TeamStoic/StoicChess/pull/42#issuecomment-235733880","issue_url":"https://api.github.com/repos/TeamStoic/StoicChess/issues/42","id":235733880,"user":{"login":"chadbaum","id":4358977,"avatar_url":"https://avatars.githubusercontent.com/u/4358977?v=3","gravatar_id":"","url":"https://api.github.com/users/chadbaum","html_url":"https://github.com/chadbaum","followers_url":"https://api.github.com/users/chadbaum/followers","following_url":"https://api.github.com/users/chadbaum/following{/other_user}","gists_url":"https://api.github.com/users/chadbaum/gists{/gist_id}","starred_url":"https://api.github.com/users/chadbaum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chadbaum/subscriptions","organizations_url":"https://api.github.com/users/chadbaum/orgs","repos_url":"https://api.github.com/users/chadbaum/repos","events_url":"https://api.github.com/users/chadbaum/events{/privacy}","received_events_url":"https://api.github.com/users/chadbaum/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T21:55:50Z","updated_at":"2016-07-27T21:55:50Z","body":"I have fully integrated capture into `move!` and rewrote all the Rspecs to test the functionality.  I will perform further optimizations as discussed above in their own PR's at later dates as they are purely optional.\r\n\r\nAll methods have been flagged private except the `move!` method, as intended."}}
{"actor":{"display_login":"chadbaum"}}