本文整理汇总了C++中SgNode::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ SgNode::Get方法的具体用法?C++ SgNode::Get怎么用?C++ SgNode::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SgNode
的用法示例。
在下文中一共展示了SgNode::Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TopProp
SgNode* SgNode::TopProp(SgPropID id) const
{
SgNode* node = const_cast<SgNode*>(this);
while (node->HasFather() && ! node->Get(id))
node = node->Father();
// Return either root node or node with property.
return node;
}
示例2: AddMove
void GoGame::AddMove(SgMove move, SgBlackWhite player,
const SgSearchStatistics* stat, bool makeMainVariation)
{
// Check whether a node with that move already exists.
SgNode* node = m_current->LeftMostSon();
while (node)
{
SgPropMove* prop = static_cast<SgPropMove*>(node->Get(SG_PROP_MOVE));
if (prop && prop->IsValue(move) && prop->IsPlayer(player))
break;
node = node->RightBrother();
}
// If no such node exists, create a new node with the given move.
if (! node)
{
if (m_current->HasSon() && 0 < m_numMovesToInsert)
{
node = m_current->LeftMostSon()->NewFather();
--m_numMovesToInsert;
}
else
{
node = m_current->NewRightMostSon();
m_numMovesToInsert = 0;
}
node->AddMoveProp(move, player);
}
// Add statistics and time left to the node.
if (stat)
AddStatisticsToNode(stat, node);
m_time.PlayedMove(*node, player);
if (makeMainVariation)
node->PromoteNode();
GoToNode(node);
}