本文整理汇总了C++中Stone::isPassed方法的典型用法代码示例。如果您正苦于以下问题:C++ Stone::isPassed方法的具体用法?C++ Stone::isPassed怎么用?C++ Stone::isPassed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stone
的用法示例。
在下文中一共展示了Stone::isPassed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: arrange
void Ground::arrange(Stone &stone_to_arrange, int bx, int by) {
if (stone_to_arrange.isPassed())
return;
// speed-up: int gx = bx / BOARD_WIDTH, gy = by / BOARD_HEIGHT;
int gx = bx >> 3, gy = by >> 3;
// speed-up: int remx = bx % BOARD_WIDTH, remy = by % BOARD_HEIGHT;
int remx = bx & 7ull, remy = by & 7ull;
BitBoard arrange = stone_to_arrange.getBitBoard();
BitBoard current = shiftDown(shiftRight(arrange, remx), remy);
BitBoard right = shiftDown(shiftLeft(arrange, BOARD_WIDTH - remx), remy);
BitBoard bottom = shiftUp(shiftRight(arrange, remx), BOARD_HEIGHT - remy);
BitBoard right_bottom = shiftUp(shiftLeft(arrange, BOARD_WIDTH - remx), BOARD_HEIGHT - remy);
_obstacle[gy * GROUND_BITBOARD_WIDTH + gx] |= current;
_obstacle[gy * GROUND_BITBOARD_WIDTH + gx + 1] |= right;
_obstacle[(gy + 1) * GROUND_BITBOARD_WIDTH + gx] |= bottom;
_obstacle[(gy + 1) * GROUND_BITBOARD_WIDTH + gx + 1] |= right_bottom;
arrangeContact(_contact, stone_to_arrange.getBitBoard(), bx - 1, by);
arrangeContact(_contact, stone_to_arrange.getBitBoard(), bx, by - 1);
arrangeContact(_contact, stone_to_arrange.getBitBoard(), bx + 1, by);
arrangeContact(_contact, stone_to_arrange.getBitBoard(), bx, by + 1);
arrangeContact(_right_contact, stone_to_arrange.getBitBoard(), bx - 1, by);
arrangeContact(_bottom_contact, stone_to_arrange.getBitBoard(), bx, by - 1);
arrangeContact(_left_contact, stone_to_arrange.getBitBoard(), bx + 1, by);
arrangeContact(_top_contact, stone_to_arrange.getBitBoard(), bx, by + 1);
updateContactAndClosedArray();
}