| 381 get_real_threats(gamestate, row, file, color, NULL, NULL) |
381 get_real_threats(gamestate, row, file, color, NULL, NULL) |
| 382 |
382 |
| 383 /** |
383 /** |
| 384 * Checks, if a specified field is protected by a piece of a certain color. |
384 * Checks, if a specified field is protected by a piece of a certain color. |
| 385 * |
385 * |
| 386 * This is the same as is_attacked(), but only considers pieces that are not |
386 * A field is protected, if any piece except the king can either capture on |
| 387 * the king. |
387 * that field or move to that field (and is not pinned). |
| 388 * |
388 * |
| 389 * @param gamestate the current game state |
389 * @param gamestate the current game state |
| 390 * @param row row of the field to check |
390 * @param row row of the field to check |
| 391 * @param file file of the field to check |
391 * @param file file of the field to check |
| 392 * @param color the color of the piece that should cover the field |
392 * @param color the color of the piece that should cover the field |
| 393 * @return true, if any piece (excluding the king) of the specified color |
393 * @return true, if any piece (excluding the king) of the specified color |
| 394 * threatens the specified field and could capture an opponent piece |
394 * can move to the specified field (including capturing moves) |
| 395 */ |
395 */ |
| 396 bool is_protected(const GameState *gamestate, Row row, File file, Color color); |
396 bool is_protected(const GameState *gamestate, Row row, File file, Color color); |
| 397 |
397 |
| 398 /** |
398 /** |
| 399 * Checks, if the specified move cannot be performed, because the piece is |
399 * Checks, if the specified move cannot be performed, because the piece is |