本文整理汇总了C++中Groups::IsGameOver方法的典型用法代码示例。如果您正苦于以下问题:C++ Groups::IsGameOver方法的具体用法?C++ Groups::IsGameOver怎么用?C++ Groups::IsGameOver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Groups
的用法示例。
在下文中一共展示了Groups::IsGameOver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: off
/** Finds inferior cells, builds vcs. Sets moves to consider to all
empty cells. If fillin causes terminal state, sets
m_fillinCausedWin to true and recomputes fillin/vcs with ice
temporarily turned off (so it can pass the players a non-empty
consider set).
*/
HexPoint BenzenePlayer::InitSearch(HexBoard& brd, HexColor color,
bitset_t& consider, double& score)
{
// Resign if the game is already over
Groups groups;
GroupBuilder::Build(brd.GetPosition(), groups);
if (groups.IsGameOver())
{
score = IMMEDIATE_LOSS;
return RESIGN;
}
StoneBoard original(brd.GetPosition());
brd.ComputeAll(color);
m_fillinCausedWin = false;
m_fillinWinner = EMPTY;
if (brd.GetGroups().IsGameOver())
{
// Fillin caused win, remove and re-compute without ice.
m_fillinCausedWin = true;
m_fillinWinner = brd.GetGroups().GetWinner();
LogInfo() << "Captured cells caused win! Removing...\n";
brd.GetPosition().SetPosition(original);
bool oldUseIce = brd.UseICE();
brd.SetUseICE(false);
brd.ComputeAll(color);
brd.SetUseICE(oldUseIce);
BenzeneAssert(!brd.GetGroups().IsGameOver());
}
consider = brd.GetPosition().GetEmpty();
score = 0;
return INVALID_POINT;
}
示例2: IsGameOver
bool GameUtil::IsGameOver(const Game& game)
{
Groups groups;
GroupBuilder::Build(game.Board(), groups);
return groups.IsGameOver();
}