troygnichols / Chessoid

Android chess
1 stars 2 forks source link

Pieces should not go through each other (except knight) #3

Closed troygnichols closed 14 years ago

troygnichols commented 14 years ago

Chess rules need to be updated to make sure pieces can't move through each other.

aasdfasdfg commented 14 years ago

This necessitates white/black queenside/kingside castle flags. The question is, where will the flags reside? Should they be fields of various ChessPieces, or should they be part of the ChessBoard class?

troygnichols commented 14 years ago

My thought on this was that we would update the logic of ChessPiece.validateMove() (and for specific subclasses for each chess piece type) to check the path between the current location and the target location and throw IllegalMove or some other exception if somebody is in the way.

troygnichols commented 14 years ago

Closing this issue since we're now going to be relying on the chess engine (GNU Chess) to decide if moves are valid or not. The "view" on the android side will just be dumb and put the chess pieces wherever the engine tell it to. So once the GNU Chess integration is done, this won't be a problem anymore.