void MGBoard::newGroup(int x, int y) { // グループ登録上限よりもビットシフトすると0になるのでエラーを出す if (latest == 0) { throw MGGroupError(); } // 新規グループに登録 board[x][y] |= latest; // 次のグループを更新 latest <<= 1; }
void MGFixedBoard::newGroup(int x, int y) { // グループ登録上限よりもビットシフトすると0になるのでエラーを出す if (latest == 0) { throw MGGroupError(); } // 新規グループに登録 *dynamic_cast<MGFixedPiece*>(board[x][y]) |= latest; // 次のグループを更新 latest <<= 1; }