本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}