troygnichols / Chessoid

Android chess
1 stars 2 forks source link

Implement Castling #4

Open troygnichols opened 14 years ago

troygnichols commented 14 years ago

Castling is not really supported in the current incarnation of the chess engine. Add some functionality so the engine can tell if a castling move will be allowed or not.

aasdfasdfg commented 14 years ago

So, clearly there will need to be 4 castling flags - queenside/kingside black/white. Which would be the "clearner" approach - have these flags as fields on the ChessPiece, or have them as fields of the ChessBoard?

troygnichols commented 14 years ago

My initial feeling is that this should be implemented in ChessBoard, or even ChessGame (game might process a castling request from the UI and determine if it's allowed based on current state of the board). I think we should add as little as possible to the ChessPiece subclasses because they are really only supposed to model chess pieces and the associated movements, etc. Do you agree?