Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpUnitMotion.h
Show All 32 Lines | |||||
*/ | */ | ||||
class ICmpUnitMotion : public IComponent | class ICmpUnitMotion : public IComponent | ||||
{ | { | ||||
public: | public: | ||||
/** | /** | ||||
* Attempt to walk into range of a to a given point, or as close as possible. | * Attempt to walk into range of a to a given point, or as close as possible. | ||||
* The range is measured from the center of the unit. | * The range is measured from the center of the unit. | ||||
* If the unit is already in range, or cannot move anywhere at all, or if there is | * If cannot move anywhere at all, or if there is some other error, then returns false. | ||||
* some other error, then returns false. | * Otherwise, returns true. | ||||
* Otherwise, returns true and sends a MotionChanged message after starting to move, | |||||
* and sends another MotionChanged after finishing moving. | |||||
* If maxRange is negative, then the maximum range is treated as infinity. | * If maxRange is negative, then the maximum range is treated as infinity. | ||||
*/ | */ | ||||
virtual bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) = 0; | virtual bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) = 0; | ||||
/** | /** | ||||
* Attempt to walk into range of a given target entity, or as close as possible. | * Attempt to walk into range of a given target entity, or as close as possible. | ||||
* The range is measured between approximately the edges of the unit and the target, so that | * The range is measured between approximately the edges of the unit and the target, so that | ||||
* maxRange=0 is not unreachably close to the target. | * maxRange=0 is not unreachably close to the target. | ||||
* If the unit is already in range, or cannot move anywhere at all, or if there is | * If the unit cannot move anywhere at all, or if there is some other error, then returns false. | ||||
* some other error, then returns false. | * Otherwise, returns true. | ||||
* Otherwise, returns true and sends a MotionChanged message after starting to move, | |||||
* and sends another MotionChanged after finishing moving. | |||||
* If maxRange is negative, then the maximum range is treated as infinity. | * If maxRange is negative, then the maximum range is treated as infinity. | ||||
*/ | */ | ||||
virtual bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) = 0; | virtual bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) = 0; | ||||
/** | /** | ||||
* Join a formation, and move towards a given offset relative to the formation controller entity. | * Join a formation, and move towards a given offset relative to the formation controller entity. | ||||
* Continues following the formation until given a different command. | * Continues following the formation until given a different command. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator