本文整理汇总了C++中Objective::GetObjectiveParent方法的典型用法代码示例。如果您正苦于以下问题:C++ Objective::GetObjectiveParent方法的具体用法?C++ Objective::GetObjectiveParent怎么用?C++ Objective::GetObjectiveParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objective
的用法示例。
在下文中一共展示了Objective::GetObjectiveParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssignUnit
int GroundTaskingManagerClass::AssignUnit (Unit u, int orders, Objective o, int score)
{
Objective so,po;
POData pod;
// SOData sod;
if (!u || !o)
return 0;
#ifdef KEV_GDEBUG
AssignedCount[orders]++;
#endif
Assigned++;
// Set local data right now...
u->SetAssigned(1);
u->SetOrdered(1);
u->SetUnitOrders(orders, o->Id());
// Now collect the SO and PO from this objective, if we don't already have them
po = so = o;
if (!so->IsSecondary() && o->GetObjectiveParent())
po = so = o->GetObjectiveParent();
if (!po->IsPrimary() && so->GetObjectiveParent())
po = so->GetObjectiveParent();
u->SetUnitObjective(o->Id());
u->SetUnitSecondaryObj(so->Id());
u->SetUnitPrimaryObj(po->Id());
// Increment unit count for this primary
pod = GetPOData(po);
if (pod)
pod->ground_assigned[owner] += u->GetTotalVehicles();
/* if (so != po)
{
sod = GetSOData(so);
if (sod)
sod->assigned[owner] += u->GetTotalVehicles();
}
*/
#ifdef KEV_GDEBUG
// char name1[128],name2[128];
// GridIndex x,y,ux,uy;
// u->GetName(name1,127);
// o->GetName(name2,127);
// u->GetLocation(&ux,&uy);
// o->GetLocation(&x,&y);
// MonoPrint("%s (%d) %s -> %s (%d) @ %d,%d - d:%d, s:%d\n",name1,u->GetCampID(),OrderStr[orders],name2,o->GetCampID(),x,y,(int)Distance(ux,uy,x,y),score);
#endif
return 1;
}