| 286 static inline void piece_remove(GameState *gamestate, Row row, File file) { |
286 static inline void piece_remove(GameState *gamestate, Row row, File file) { |
| 287 piece_set(gamestate, row, file, 0); |
287 piece_set(gamestate, row, file, 0); |
| 288 } |
288 } |
| 289 |
289 |
| 290 /** |
290 /** |
| 291 * Determines a list of possible moves to the specified field. |
291 * Determines a list of theoretically possible moves to the specified field. |
| |
292 * |
| |
293 * This will also list moves for pieces that are actually pinned. |
| 292 * |
294 * |
| 293 * The out-parameters may both be NULL, but if any of them is set, the other |
295 * The out-parameters may both be NULL, but if any of them is set, the other |
| 294 * must be set, too. |
296 * must be set, too. |
| 295 * |
297 * |
| 296 * @param gamestate the current game state |
298 * @param gamestate the current game state |
| 299 * @param color the color of the piece that should move to the field |
301 * @param color the color of the piece that should move to the field |
| 300 * @param moves the array where to store the moves |
302 * @param moves the array where to store the moves |
| 301 * (must be large enough, 16 is always enough) |
303 * (must be large enough, 16 is always enough) |
| 302 * @param movecount a pointer where the number of moves is stored |
304 * @param movecount a pointer where the number of moves is stored |
| 303 * @return true, if any piece of the specified color can move to the specified |
305 * @return true, if any piece of the specified color can move to the specified |
| 304 * field |
306 * field regardless of being pinned |
| 305 */ |
307 */ |
| 306 bool get_candidates(const GameState *gamestate, Row row, File file, |
308 bool get_candidates(const GameState *gamestate, Row row, File file, |
| 307 Color color, Move* moves, size_t* movecount); |
309 Color color, Move* moves, size_t* movecount); |
| 308 |
310 |
| 309 /** |
311 /** |