Esempio n. 1
0
void MGBoard::newGroup(int x, int y)
{
	// グループ登録上限よりもビットシフトすると0になるのでエラーを出す
	if (latest == 0) {
		throw MGGroupError();
	}

	// 新規グループに登録
	board[x][y] |= latest;

	// 次のグループを更新
	latest <<= 1;
}
Esempio n. 2
0
void MGFixedBoard::newGroup(int x, int y)
{
	// グループ登録上限よりもビットシフトすると0になるのでエラーを出す
	if (latest == 0) {
		throw MGGroupError();
	}

	// 新規グループに登録
	*dynamic_cast<MGFixedPiece*>(board[x][y]) |= latest;

	// 次のグループを更新
	latest <<= 1;
}