本文整理汇总了C++中Objective::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Objective::GetName方法的具体用法?C++ Objective::GetName怎么用?C++ Objective::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objective
的用法示例。
在下文中一共展示了Objective::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDeaggregationPoint
int TaskForceClass::GetDeaggregationPoint (int slot, CampEntity *installation)
{
int pt=0,type;
static int last_pt, index = 0;
if (!*installation)
{
// We're looking for a new list, so clear statics
last_pt = index = 0;
// Check if we care about placement
if (!Moving())
{
// Find the appropriate installation
GridIndex x,y;
Objective o;
GetLocation(&x,&y);
o = FindNearestObjective (x,y,NULL,0);
*installation = o;
// Find the appropriate list
if (o)
{
ObjClassDataType *oc = o->GetObjectiveClassData();
index = oc->PtDataIndex;
while (index)
{
if (PtHeaderDataTable[index].type == DockListType)
{
// The first time we look, we just want to know if we have a list.
// Return now.
return index;
}
index = PtHeaderDataTable[index].nextHeader;
}
#ifdef DEBUG
FILE *fp = fopen("PtDatErr.log","a");
if (fp)
{
char name[80];
o->GetName(name,79,FALSE);
fprintf(fp, "Obj %s @ %d,%d: No header list of type %d.\n",name,x,y,DockListType);
fclose(fp);
}
#endif
}
}
}
if (index)
{
// We have a list, and want to find the correct point
UnitClassDataType *uc = GetUnitClassData();
VehicleClassDataType *vc = GetVehicleClassData(uc->VehicleType[slot]);
// Check which type of point we're looking for
// TODO: Check ship type here...
// type = SmallDockPt;
type = LargeDockPt;
// Return the next point, if it's the base type
// NOTE: Log error if we don't have enough points of this type
if (last_pt)
{
last_pt = pt = GetNextPt(last_pt);
#ifdef DEBUG
if (!pt || PtDataTable[pt].type != type)
{
FILE *fp = fopen("PtDatErr.log","a");
if (fp)
{
char name[80];
GridIndex x,y;
(*installation)->GetName(name,79,FALSE);
(*installation)->GetLocation(&x,&y);
fprintf(fp, "HeaderList %d (Obj %s @ %d,%d): Insufficient points of type %d.\n",index,name,x,y,type);
fclose(fp);
}
}
#endif
return pt;
}
// Find one of the appropriate type
pt = GetFirstPt(index);
while (pt)
{
if (PtDataTable[pt].type == type)
{
last_pt = pt;
return pt;
}
pt = GetNextPt(pt);
}
#ifdef DEBUG
FILE *fp = fopen("PtDatErr.log","a");
if (fp)
{
char name[80];
GridIndex x,y;
//.........这里部分代码省略.........