当前位置: 首页>>代码示例>>C++>>正文


C++ DROID_GROUP::getNumMembers方法代码示例

本文整理汇总了C++中DROID_GROUP::getNumMembers方法的典型用法代码示例。如果您正苦于以下问题:C++ DROID_GROUP::getNumMembers方法的具体用法?C++ DROID_GROUP::getNumMembers怎么用?C++ DROID_GROUP::getNumMembers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DROID_GROUP的用法示例。


在下文中一共展示了DROID_GROUP::getNumMembers方法的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;
}
开发者ID:Cjkjvfnby,项目名称:warzone2100,代码行数:31,代码来源:scriptai.cpp

示例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;
}
开发者ID:Cjkjvfnby,项目名称:warzone2100,代码行数:38,代码来源:scriptai.cpp

示例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;
}
开发者ID:Cjkjvfnby,项目名称:warzone2100,代码行数:37,代码来源:scriptai.cpp


注:本文中的DROID_GROUP::getNumMembers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。