bool GameSession::IsWin()

in GomokuServer/GomokuServer/GameSession.cpp [179:202]


bool GameSession::IsWin(StoneType st)
{
    for (int l = 0; l < BOARD_SIZE; ++l)
    {
        for (int i1 = 0; i1 < BOARD_SIZE; ++i1)
        {
            if (l < BOARD_SIZE - 4 && CheckLine(st, l, i1, 1, 0))
                return true;

            if (l < BOARD_SIZE - 4 && i1 < BOARD_SIZE - 4 && CheckLine(st, l, i1, 1, 1))
                return true;

            if (i1 < BOARD_SIZE - 4 && CheckLine(st, l, i1, 0, 1))
                return true;

            if (l <= 3 || i1 >= BOARD_SIZE - 4 || !CheckLine(st, l, i1, -1, 1))
                continue;

            return true;
        }
    }

    return false;
}