Pyrogenesis
trunk
|
Public Member Functions | |
CCmpUnitMotionScripted (const ScriptInterface &scriptInterface, JS::HandleValue instance) | |
void | Init (const CParamNode ¶mNode) override |
void | Deinit () override |
void | HandleMessage (const CMessage &msg, bool global) override |
void | Serialize (ISerializer &serialize) override |
void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) override |
JS::Value | GetJSInstance () const override |
int | GetComponentTypeId () const override |
bool | MoveToPointRange (entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) override |
Attempt to walk into range of a to a given point, or as close as possible. More... | |
bool | MoveToTargetRange (entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override |
Attempt to walk into range of a given target entity, or as close as possible. More... | |
void | MoveToFormationOffset (entity_id_t target, entity_pos_t x, entity_pos_t z) override |
Join a formation, and move towards a given offset relative to the formation controller entity. More... | |
void | SetMemberOfFormation (entity_id_t controller) override |
Set/unset the unit as a formation member. More... | |
bool | IsTargetRangeReachable (entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override |
Check if the target is reachable. More... | |
void | FaceTowardsPoint (entity_pos_t x, entity_pos_t z) override |
Turn to look towards the given point. More... | |
void | StopMoving () override |
Stop moving immediately. More... | |
fixed | GetCurrentSpeed () const override |
Get the speed at the end of the current turn. More... | |
bool | IsMoveRequested () const override |
fixed | GetSpeed () const override |
Get the speed at which the unit intends to move. More... | |
fixed | GetWalkSpeed () const override |
Get the unit template walk speed after modifications. More... | |
fixed | GetRunMultiplier () const override |
Get the unit template running (i.e. More... | |
void | SetSpeedMultiplier (fixed multiplier) override |
Set the current movement speed. More... | |
fixed | GetSpeedMultiplier () const override |
Returns the ratio of GetSpeed() / GetWalkSpeed(). More... | |
CFixedVector2D | EstimateFuturePosition (const fixed dt) const override |
fixed | GetAcceleration () const override |
Get the current acceleration. More... | |
void | SetAcceleration (fixed acceleration) override |
Set the current acceleration. More... | |
void | SetFacePointAfterMove (bool facePointAfterMove) override |
Set whether the unit will turn to face the target point after finishing moving. More... | |
bool | GetFacePointAfterMove () const override |
pass_class_t | GetPassabilityClass () const override |
Get the unit's passability class. More... | |
std::string | GetPassabilityClassName () const override |
Get the passability class name (as defined in pathfinder.xml) More... | |
void | SetPassabilityClassName (const std::string &passClassName) override |
Sets the passability class name (as defined in pathfinder.xml) More... | |
entity_pos_t | GetUnitClearance () const override |
Get the unit clearance (used by the Obstruction component) More... | |
void | SetDebugOverlay (bool enabled) override |
Toggle the rendering of debug info. More... | |
Public Member Functions inherited from IComponent | |
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 (const ScriptInterface &scriptInterface, JS::MutableHandleObject out) const |
Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More... | |
Static Public Member Functions | |
static void | ClassInit (CComponentManager &componentManager) |
static IComponent * | Allocate (const ScriptInterface &scriptInterface, JS::HandleValue instance) |
static void | Deallocate (IComponent *cmp) |
static std::string | GetSchema () |
Static Public Member Functions inherited from IComponent | |
static std::string | GetSchema () |
static void | RegisterComponentType (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema) |
static void | RegisterComponentTypeScriptWrapper (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema) |
static u8 | GetSerializationVersion () |
Private Attributes | |
CComponentTypeScript | m_Script |
Additional Inherited Members | |
Public Types inherited from IComponent | |
using | AllocFunc = IComponent *(*)(const ScriptInterface &scriptInterface, JS::HandleValue ctor) |
using | DeallocFunc = void(*)(IComponent *) |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlineoverridevirtual |
Implements IComponent.
|
inlineoverridevirtual |
Implements IComponent.
|
inlineoverridevirtual |
dt | seconds, following current paths. This is allowed to 'look into the future'. |
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Turn to look towards the given point.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Get the current acceleration.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Implements IComponent.
|
inlineoverridevirtual |
Get the speed at the end of the current turn.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Reimplemented from IComponent.
|
inlineoverridevirtual |
Get the unit's passability class.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Get the passability class name (as defined in pathfinder.xml)
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
|
inlinestatic |
|
inlineoverridevirtual |
Get the speed at which the unit intends to move.
(regardless of whether the unit is moving or not right now).
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Returns the ratio of GetSpeed() / GetWalkSpeed().
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Get the unit clearance (used by the Obstruction component)
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Get the unit template walk speed after modifications.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Reimplemented from IComponent.
|
inlineoverridevirtual |
Implements IComponent.
|
inlineoverridevirtual |
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Check if the target is reachable.
Don't take this as absolute gospel since there are things that the pathfinder may not detect, such as entity obstructions in the way, but in general it should return satisfactory results. The interface is similar to MoveToTargetRange but the move is not attempted.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Join a formation, and move towards a given offset relative to the formation controller entity.
The unit will remain 'in formation' fromthe perspective of UnitMotion until SetMemberOfFormation(INVALID_ENTITY) is passed.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
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 cannot move anywhere at all, or if there is some other error, then returns false. Otherwise, returns true. If maxRange is negative, then the maximum range is treated as infinity.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
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 cannot move anywhere at all, or if there is some other error, then returns false. Otherwise, returns true. If maxRange is negative, then the maximum range is treated as infinity.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Implements IComponent.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Toggle the rendering of debug info.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Set whether the unit will turn to face the target point after finishing moving.
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Set/unset the unit as a formation member.
controller | - if INVALID_ENTITY, the unit is no longer a formation member. Otherwise it is and this is the controller. |
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Sets the passability class name (as defined in pathfinder.xml)
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Set the current movement speed.
speed | A multiplier of GetWalkSpeed(). |
Implements ICmpUnitMotion.
|
inlineoverridevirtual |
Stop moving immediately.
Implements ICmpUnitMotion.
|
private |