示例#1
0
文件: World.cpp 项目: turrikasd/BLOK
void World::GetBlocks(int x, int z)
{
	mutexes[x][z].lock();

	if (!IsGenerated(x, z))
		GenBlocks(x, z);

	mutexes[x][z].unlock();
}
void GoRegionBoard::GenBlocksRegions()
{
    if (UpToDate())
        return;

    Clear();
    GenBlocks();

    for (SgBWIterator it; it; ++it)
    {
        SgBlackWhite color(*it);
        for (SgConnCompIterator it(AllPoints() - All(color), Board().Size());
             it; ++it)
            GenRegion(*it, color);
    }

    FindBlocksWithEye();

    m_code = Board().GetHashCode();
    m_invalid = false;
    if (HEAVYCHECK)
        CheckConsistency();
}