本文整理汇总了C++中StateType::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ StateType::Clone方法的具体用法?C++ StateType::Clone怎么用?C++ StateType::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StateType
的用法示例。
在下文中一共展示了StateType::Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MetaGame_multi_player
void ForwardDeadReckoningPropnetStateMachine::MetaGame_multi_player(size_t simulation_time)
{
isZeroSumGame = true;
isAlternatingMoves = true;
size_t num_simulations = 0;
size_t stop = util::Timer::microtimer() + simulation_time;
StateType temp;
for(size_t i = 0;i < core::RawAState::arr_size;i++)
temp->s[i] = 255;
alt_role_masks = new StateType[role_size];
for(size_t i = 0;i < role_size;i++)
alt_role_masks[i] = temp.Clone();
while(util::Timer::microtimer() < stop)
{
StateType temp = InitState().Clone();
MoveType m;
while(!initial_pn.Update(temp, *initial_pn_payload))
{
if(isAlternatingMoves)
{
int current_control_r_id = -1;
for(size_t i = 0;i < role_size;i++)
{
if(initial_pn_payload->legal_size[i] > 1)
{
if(current_control_r_id > -1)
{
isAlternatingMoves = false;
break;
}
else current_control_r_id = i;
}
}
if(current_control_r_id != -1)
alt_role_masks[current_control_r_id] = temp & std::move(alt_role_masks[current_control_r_id]);
}
initial_pn.GetRandomLegalMove(*initial_pn_payload, m);
initial_pn.Update(m, *initial_pn_payload);
temp.Equate(initial_pn_payload->top);
//cout << m << endl;
//cout << temp << endl;
//
// size_t t;
// cin >> t;
}
if(isZeroSumGame)
CheckZeroSumGame();
num_simulations++;
}
log.Info << "Performed " << num_simulations << " simulations in meta game simulations." << std::endl;
if(isZeroSumGame)
{
log.Info << "Game is Zero-Sum game." << std::endl;
}
if(isAlternatingMoves)
{
log.Info << "Game with alternating moves." << std::endl;
}
else
{
delete[] alt_role_masks;
alt_role_masks = NULL;
}
}