本文整理汇总了C++中DROID_GROUP::orderGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ DROID_GROUP::orderGroup方法的具体用法?C++ DROID_GROUP::orderGroup怎么用?C++ DROID_GROUP::orderGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DROID_GROUP
的用法示例。
在下文中一共展示了DROID_GROUP::orderGroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scrOrderGroup
// Give a group an order
bool scrOrderGroup(void)
{
DROID_GROUP *psGroup;
DROID_ORDER order;
if (!stackPopParams(2, ST_GROUP, &psGroup, VAL_INT, &order))
{
return false;
}
ASSERT(psGroup != NULL,
"scrOrderGroup: Invalid group pointer");
if (order != DORDER_STOP &&
order != DORDER_RETREAT &&
order != DORDER_DESTRUCT &&
order != DORDER_RTR &&
order != DORDER_RTB &&
order != DORDER_RUN)
{
ASSERT(false,
"scrOrderGroup: Invalid order");
return false;
}
debug(LOG_NEVER, "group %p (%u) order %d", psGroup, psGroup->getNumMembers(), order);
psGroup->orderGroup(order);
return true;
}
示例2: scrOrderGroupObj
// Give a group an order to an object
bool scrOrderGroupObj(void)
{
DROID_GROUP *psGroup;
DROID_ORDER order;
BASE_OBJECT *psObj;
if (!stackPopParams(3, ST_GROUP, &psGroup, VAL_INT, &order, ST_BASEOBJECT, &psObj))
{
return false;
}
ASSERT(psGroup != NULL,
"scrOrderGroupObj: Invalid group pointer");
ASSERT(psObj != NULL,
"scrOrderGroupObj: Invalid object pointer");
if (order != DORDER_ATTACK &&
order != DORDER_HELPBUILD &&
order != DORDER_DEMOLISH &&
order != DORDER_REPAIR &&
order != DORDER_OBSERVE &&
order != DORDER_EMBARK &&
order != DORDER_FIRESUPPORT &&
order != DORDER_DROIDREPAIR)
{
ASSERT(false,
"scrOrderGroupObj: Invalid order");
return false;
}
debug(LOG_NEVER, "group %p (%u) order %d, obj type %d player %d id %d",
psGroup, psGroup->getNumMembers(), order, psObj->type, psObj->player, psObj->id);
psGroup->orderGroup(order, psObj);
return true;
}
示例3: scrOrderGroupLoc
// Give a group an order to a location
bool scrOrderGroupLoc(void)
{
DROID_GROUP *psGroup;
DROID_ORDER order;
SDWORD x, y;
if (!stackPopParams(4, ST_GROUP, &psGroup, VAL_INT, &order, VAL_INT, &x, VAL_INT, &y))
{
return false;
}
ASSERT(psGroup != NULL,
"scrOrderGroupLoc: Invalid group pointer");
if (order != DORDER_MOVE &&
order != DORDER_SCOUT)
{
ASSERT(false,
"scrOrderGroupLoc: Invalid order");
return false;
}
if (x < 0
|| x > world_coord(mapWidth)
|| y < 0
|| y > world_coord(mapHeight))
{
ASSERT(false, "Invalid map location (%d, %d), max is (%d, %d)", x, y, world_coord(mapWidth), world_coord(mapHeight));
return false;
}
debug(LOG_NEVER, "group %p (%u) order %d (%d,%d)",
psGroup, psGroup->getNumMembers(), order, x, y);
psGroup->orderGroup(order, (UDWORD)x, (UDWORD)y);
return true;
}