|
virtual int | GetComponentTypeId () const |
|
virtual void | Init (const CParamNode ¶mNode) |
|
virtual void | Deinit () |
|
template<typename S > |
void | SerializeCommon (S &serialize) |
|
virtual void | Serialize (ISerializer &serialize) |
|
virtual void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) |
|
virtual void | HandleMessage (const CMessage &msg, bool global) |
|
void | UpdateMessageSubscriptions () |
|
virtual bool | IsMoving () const |
| Get whether the unit is moving. More...
|
|
virtual fixed | GetWalkSpeed () const |
| Get the default speed that this unit will have when walking, in metres per second. More...
|
|
virtual fixed | GetRunSpeed () const |
| Get the default speed that this unit will have when running, in metres per second. More...
|
|
virtual pass_class_t | GetPassabilityClass () const |
| Get the unit's passability class. More...
|
|
virtual std::string | GetPassabilityClassName () const |
| Get the passability class name (as defined in pathfinder.xml) More...
|
|
virtual void | SetPassabilityClassName (const std::string &passClassName) |
|
virtual fixed | GetCurrentSpeed () const |
| Get the current movement speed. More...
|
|
virtual void | SetSpeed (fixed speed) |
| Set the current movement speed. More...
|
|
virtual void | SetFacePointAfterMove (bool facePointAfterMove) |
| Set whether the unit will turn to face the target point after finishing moving. More...
|
|
virtual void | SetDebugOverlay (bool enabled) |
| Toggle the rendering of debug info. More...
|
|
virtual bool | MoveToPointRange (entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) |
| Attempt to walk into range of a to a given point, or as close as possible. More...
|
|
virtual bool | IsInPointRange (entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) const |
| Determine wether the givven point is within the given range, using the same measurement as MoveToPointRange. More...
|
|
virtual bool | MoveToTargetRange (entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) |
| Attempt to walk into range of a given target entity, or as close as possible. More...
|
|
virtual bool | IsInTargetRange (entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) const |
| Determine whether the target is within the given range, using the same measurement as MoveToTargetRange. More...
|
|
virtual void | MoveToFormationOffset (entity_id_t target, entity_pos_t x, entity_pos_t z) |
| Join a formation, and move towards a given offset relative to the formation controller entity. More...
|
|
virtual void | FaceTowardsPoint (entity_pos_t x, entity_pos_t z) |
| Turn to look towards the given point. More...
|
|
virtual void | StopMoving () |
| Stop moving immediately. More...
|
|
virtual entity_pos_t | GetUnitClearance () const |
| Get the unit clearance (used by the Obstruction component) More...
|
|
virtual | ~IComponent () |
|
CEntityHandle | GetEntityHandle () const |
|
void | SetEntityHandle (CEntityHandle ent) |
|
entity_id_t | GetEntityId () const |
|
CEntityHandle | GetSystemEntity () const |
|
const CSimContext & | GetSimContext () const |
|
void | SetSimContext (const CSimContext &context) |
|
virtual bool | NewJSObject (ScriptInterface &scriptInterface, JS::MutableHandleObject out) const |
| Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More...
|
|
virtual JS::Value | GetJSInstance () const |
|
|
bool | ShouldAvoidMovingUnits () const |
|
bool | IsFormationMember () const |
|
entity_id_t | GetGroup () const |
|
bool | HasValidPath () const |
|
void | StartFailed () |
|
void | MoveFailed () |
|
void | StartSucceeded () |
|
void | MoveSucceeded () |
|
bool | MoveToPointRange (entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange, entity_id_t target) |
|
void | PathResult (u32 ticket, const WaypointPath &path) |
| Handle the result of an asynchronous path query. More...
|
|
void | Move (fixed dt) |
| Do the per-turn movement and other updates. More...
|
|
bool | ShouldTreatTargetAsCircle (entity_pos_t range, entity_pos_t circleRadius) const |
| Decide whether to approximate the given range from a square target as a circle, rather than as a square. More...
|
|
bool | ComputeTargetPosition (CFixedVector2D &out) const |
| Computes the current location of our target entity (plus offset). More...
|
|
bool | TryGoingStraightToGoalPoint (const CFixedVector2D &from) |
| Attempts to replace the current path with a straight line to the goal, if this goal is a point, is close enough and the route is not obstructed. More...
|
|
bool | TryGoingStraightToTargetEntity (const CFixedVector2D &from) |
| Attempts to replace the current path with a straight line to the target entity, if it's close enough and the route is not obstructed. More...
|
|
bool | CheckTargetMovement (const CFixedVector2D &from, entity_pos_t minDelta) |
| Returns whether the target entity has moved more than minDelta since our last path computations, and we're close enough to it to care. More...
|
|
void | UpdateFinalGoal () |
| Update goal position if moving target. More...
|
|
bool | ShouldConsiderOurselvesAtDestination (const CFixedVector2D &from) |
| Returns whether we are close enough to the target to assume it's a good enough position to stop. More...
|
|
bool | PathIsShort (const WaypointPath &path, const CFixedVector2D &from, entity_pos_t minDistance) const |
| Returns whether the length of the given path, plus the distance from 'from' to the first waypoints, it shorter than minDistance. More...
|
|
void | FaceTowardsPointFromPos (const CFixedVector2D &pos, entity_pos_t x, entity_pos_t z) |
| Rotate to face towards the target point, given the current pos. More...
|
|
ControlGroupMovementObstructionFilter | GetObstructionFilter (bool noTarget=false) const |
| Returns an appropriate obstruction filter for use with path requests. More...
|
|
void | BeginPathing (const CFixedVector2D &from, const PathGoal &goal) |
| Start moving to the given goal, from our current position 'from'. More...
|
|
void | RequestLongPath (const CFixedVector2D &from, const PathGoal &goal) |
| Start an asynchronous long path query. More...
|
|
void | RequestShortPath (const CFixedVector2D &from, const PathGoal &goal, bool avoidMovingUnits) |
| Start an asynchronous short path query. More...
|
|
void | RenderPath (const WaypointPath &path, std::vector< SOverlayLine > &lines, CColor color) |
| Convert a path into a renderable list of lines. More...
|
|
void | RenderSubmit (SceneCollector &collector) |
|
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. If the unit is already in range, or cannot move anywhere at all, or if there is some other error, then returns false. 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.
Implements ICmpUnitMotion.
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 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 some other error, then returns false. 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.
Implements ICmpUnitMotion.