1
0
forked from mirrors/0ad

Extend animal AI to all animals.

This was SVN commit r7771.
This commit is contained in:
Ykkrosh
2010-07-20 08:45:09 +00:00
parent c4350d86de
commit bd2fd6c713
21 changed files with 115 additions and 83 deletions
@@ -214,9 +214,9 @@ public:
return m_RunSpeed;
}
virtual void SetSpeedFactor(fixed factor)
virtual void SetSpeed(fixed speed)
{
m_Speed = m_WalkSpeed.Multiply(factor);
m_Speed = speed;
}
virtual void SetDebugOverlay(bool enabled)
@@ -27,6 +27,8 @@ DEFINE_INTERFACE_METHOD_3("IsInAttackRange", bool, ICmpUnitMotion, IsInAttackRan
DEFINE_INTERFACE_METHOD_3("MoveToAttackRange", bool, ICmpUnitMotion, MoveToAttackRange, entity_id_t, entity_pos_t, entity_pos_t)
DEFINE_INTERFACE_METHOD_4("MoveToPointRange", bool, ICmpUnitMotion, MoveToPointRange, entity_pos_t, entity_pos_t, entity_pos_t, entity_pos_t)
DEFINE_INTERFACE_METHOD_0("StopMoving", void, ICmpUnitMotion, StopMoving)
DEFINE_INTERFACE_METHOD_1("SetSpeedFactor", void, ICmpUnitMotion, SetSpeedFactor, fixed)
DEFINE_INTERFACE_METHOD_1("SetSpeed", void, ICmpUnitMotion, SetSpeed, fixed)
DEFINE_INTERFACE_METHOD_0("GetWalkSpeed", fixed, ICmpUnitMotion, GetWalkSpeed)
DEFINE_INTERFACE_METHOD_0("GetRunSpeed", fixed, ICmpUnitMotion, GetRunSpeed)
DEFINE_INTERFACE_METHOD_1("SetDebugOverlay", void, ICmpUnitMotion, SetDebugOverlay, bool)
END_INTERFACE_WRAPPER(UnitMotion)
@@ -71,9 +71,9 @@ public:
virtual void StopMoving() = 0;
/**
* Set the current movement speed to be the default multiplied by the given factor.
* Set the current movement speed.
*/
virtual void SetSpeedFactor(fixed factor) = 0;
virtual void SetSpeed(fixed speed) = 0;
/**
* Get the default speed that this unit will have when walking, in metres per second.