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


C++ CCommandAI::CanSetMaxSpeed方法代码示例

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


在下文中一共展示了CCommandAI::CanSetMaxSpeed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddUnitSetMaxSpeedCommand

inline void CSelectedUnitsAI::AddUnitSetMaxSpeedCommand(CUnit* unit,
                                                        unsigned char options)
{
	// sets the wanted speed of this unit to its max speed
	CCommandAI* cai = unit->commandAI;
	if (cai->CanSetMaxSpeed()) {
		Command c(CMD_SET_WANTED_MAX_SPEED, options);
		c.AddParam(unit->moveType->GetMaxSpeed());
		cai->GiveCommand(c, false);
	}
}
开发者ID:FriedRice,项目名称:spring,代码行数:11,代码来源:SelectedUnitsAI.cpp

示例2: AddUnitSetMaxSpeedCommand

inline void CSelectedUnitsAI::AddUnitSetMaxSpeedCommand(CUnit* unit,
        unsigned char options)
{
    // sets the wanted speed of this unit to its max speed
    CCommandAI* cai = unit->commandAI;
    if (cai->CanSetMaxSpeed()) {
        Command c;
        c.id = CMD_SET_WANTED_MAX_SPEED;
        c.options = options;
        c.params.push_back(unit->maxSpeed);
        cai->GiveCommand(c, false);
    }
}
开发者ID:ricochet1k,项目名称:spring,代码行数:13,代码来源:SelectedUnitsAI.cpp

示例3: AddGroupSetMaxSpeedCommand

inline void CSelectedUnitsAI::AddGroupSetMaxSpeedCommand(CUnit* unit,
                                                         unsigned char options)
{
	// sets the wanted speed of this unit to the group minimum
	// (note: was being divided by GAME_SPEED, but minMaxSpeed
	// is already in units per frame)
	CCommandAI* cai = unit->commandAI;
	if (cai->CanSetMaxSpeed()) {
		Command c(CMD_SET_WANTED_MAX_SPEED, options);
		c.AddParam(minMaxSpeed);
		cai->GiveCommand(c, false);
	}
}
开发者ID:FriedRice,项目名称:spring,代码行数:13,代码来源:SelectedUnitsAI.cpp

示例4: AddGroupSetMaxSpeedCommand

inline void CSelectedUnitsAI::AddGroupSetMaxSpeedCommand(CUnit* unit,
                                                         unsigned char options)
{
	// sets the wanted speed of this unit to the group minimum
	CCommandAI* cai = unit->commandAI;
	if (cai->CanSetMaxSpeed()) {
		Command c;
		c.id = CMD_SET_WANTED_MAX_SPEED;
		c.options = options;
		c.params.push_back(minMaxSpeed / 30.0f);
		cai->GiveCommand(c);
	}
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:13,代码来源:SelectedUnitsAI.cpp

示例5: AddGroupSetMaxSpeedCommand

inline void CSelectedUnitsHandlerAI::AddGroupSetMaxSpeedCommand(CUnit* unit,
                                                         unsigned char options)
{
	// sets the wanted speed of this unit to that of
	// the group's current-slowest member (minMaxSpeed
	// is derived from GetMaxSpeed, not GetMaxSpeedDef)
	CCommandAI* cai = unit->commandAI;

	if (cai->CanSetMaxSpeed()) {
		Command c(CMD_SET_WANTED_MAX_SPEED, options, minMaxSpeed);

		cai->GiveCommand(c, false);
	}
}
开发者ID:nixtux,项目名称:spring,代码行数:14,代码来源:SelectedUnitsAI.cpp

示例6: AddUnitSetMaxSpeedCommand

inline void CSelectedUnitsHandlerAI::AddUnitSetMaxSpeedCommand(CUnit* unit,
                                                        unsigned char options)
{
	// this sets the WANTED maximum speed of <unit>
	// (via the CommandAI --> MoveType chain) to be
	// equal to its current ACTUAL maximum (not the
	// UnitDef maximum, which can be overridden by
	// scripts)
	CCommandAI* cai = unit->commandAI;

	if (cai->CanSetMaxSpeed()) {
		Command c(CMD_SET_WANTED_MAX_SPEED, options, unit->moveType->GetMaxSpeed());

		cai->GiveCommand(c, false);
	}
}
开发者ID:nixtux,项目名称:spring,代码行数:16,代码来源:SelectedUnitsAI.cpp


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