src/chess/rules.h

changeset 166
1a9b662bc201
parent 163
2a6d83f4677e
child 167
fd1d3f0a7a73
equal deleted inserted replaced
165:3e27c99ed721 166:1a9b662bc201
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

mercurial