Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CCmpUnitMotionScripted Class Reference
Inheritance diagram for CCmpUnitMotionScripted:
ICmpUnitMotion IComponent

Public Member Functions

 CCmpUnitMotionScripted (ScriptInterface &scriptInterface, jsval instance)
 
virtual void Init (const CParamNode &paramNode)
 
virtual void Deinit ()
 
virtual void HandleMessage (const CMessage &msg, bool global)
 
virtual void Serialize (ISerializer &serialize)
 
virtual void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize)
 
virtual jsval GetJSInstance () const
 
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)
 Determine wether the givven point is within the given range, using the same measurement as MoveToPointRange. More...
 
virtual bool IsInTargetRange (entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange)
 Determine whether the target is within the given range, using the same measurement as MoveToTargetRange. 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 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 fixed GetCurrentSpeed ()
 Get the current movement speed. More...
 
virtual void SetSpeed (fixed speed)
 Set the current movement speed. More...
 
virtual bool IsMoving ()
 Get whether the unit is moving. More...
 
virtual fixed GetWalkSpeed ()
 Get the default speed that this unit will have when walking, in metres per second. More...
 
virtual fixed GetRunSpeed ()
 Get the default speed that this unit will have when running, in metres per second. More...
 
virtual void SetFacePointAfterMove (bool facePointAfterMove)
 Set whether the unit will turn to face the target point after finishing moving. More...
 
virtual
ICmpPathfinder::pass_class_t 
GetPassabilityClass ()
 Get the unit's passability class. More...
 
virtual void SetUnitRadius (fixed radius)
 Override the default obstruction radius, used for planning paths and checking for collisions. More...
 
virtual void SetDebugOverlay (bool enabled)
 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 CSimContextGetSimContext () const
 
void SetSimContext (const CSimContext &context)
 
virtual JSClass * GetJSClass () const
 

Static Public Member Functions

static void ClassInit (CComponentManager &componentManager)
 
static IComponentAllocate (ScriptInterface &scriptInterface, jsval instance)
 
static void Deallocate (IComponent *cmp)
 
static std::string GetSchema ()
 
- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static u8 GetSerializationVersion ()
 

Private Attributes

CComponentTypeScript m_Script
 

Detailed Description

Definition at line 43 of file ICmpUnitMotion.cpp.

Constructor & Destructor Documentation

CCmpUnitMotionScripted::CCmpUnitMotionScripted ( ScriptInterface scriptInterface,
jsval  instance 
)
inline

Definition at line 46 of file ICmpUnitMotion.cpp.

Member Function Documentation

static IComponent* CCmpUnitMotionScripted::Allocate ( ScriptInterface scriptInterface,
jsval  instance 
)
inlinestatic

Definition at line 46 of file ICmpUnitMotion.cpp.

static void CCmpUnitMotionScripted::ClassInit ( CComponentManager componentManager)
inlinestatic

Definition at line 46 of file ICmpUnitMotion.cpp.

static void CCmpUnitMotionScripted::Deallocate ( IComponent cmp)
inlinestatic

Definition at line 46 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::Deinit ( )
inlinevirtual

Implements IComponent.

Definition at line 46 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::Deserialize ( const CParamNode paramNode,
IDeserializer deserialize 
)
inlinevirtual

Implements IComponent.

Definition at line 46 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::FaceTowardsPoint ( entity_pos_t  x,
entity_pos_t  z 
)
inlinevirtual

Turn to look towards the given point.

Implements ICmpUnitMotion.

Definition at line 73 of file ICmpUnitMotion.cpp.

virtual fixed CCmpUnitMotionScripted::GetCurrentSpeed ( )
inlinevirtual

Get the current movement speed.

Implements ICmpUnitMotion.

Definition at line 83 of file ICmpUnitMotion.cpp.

virtual jsval CCmpUnitMotionScripted::GetJSInstance ( ) const
inlinevirtual

Reimplemented from IComponent.

Definition at line 46 of file ICmpUnitMotion.cpp.

virtual ICmpPathfinder::pass_class_t CCmpUnitMotionScripted::GetPassabilityClass ( )
inlinevirtual

Get the unit's passability class.

Implements ICmpUnitMotion.

Definition at line 113 of file ICmpUnitMotion.cpp.

virtual fixed CCmpUnitMotionScripted::GetRunSpeed ( )
inlinevirtual

Get the default speed that this unit will have when running, in metres per second.

Implements ICmpUnitMotion.

Definition at line 103 of file ICmpUnitMotion.cpp.

static std::string CCmpUnitMotionScripted::GetSchema ( )
inlinestatic

Definition at line 46 of file ICmpUnitMotion.cpp.

virtual fixed CCmpUnitMotionScripted::GetWalkSpeed ( )
inlinevirtual

Get the default speed that this unit will have when walking, in metres per second.

Implements ICmpUnitMotion.

Definition at line 98 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::HandleMessage ( const CMessage msg,
bool  global 
)
inlinevirtual

Reimplemented from IComponent.

Definition at line 46 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::Init ( const CParamNode paramNode)
inlinevirtual

Implements IComponent.

Definition at line 46 of file ICmpUnitMotion.cpp.

virtual bool CCmpUnitMotionScripted::IsInPointRange ( entity_pos_t  x,
entity_pos_t  z,
entity_pos_t  minRange,
entity_pos_t  maxRange 
)
inlinevirtual

Determine wether the givven point is within the given range, using the same measurement as MoveToPointRange.

Implements ICmpUnitMotion.

Definition at line 53 of file ICmpUnitMotion.cpp.

virtual bool CCmpUnitMotionScripted::IsInTargetRange ( entity_id_t  target,
entity_pos_t  minRange,
entity_pos_t  maxRange 
)
inlinevirtual

Determine whether the target is within the given range, using the same measurement as MoveToTargetRange.

Implements ICmpUnitMotion.

Definition at line 58 of file ICmpUnitMotion.cpp.

virtual bool CCmpUnitMotionScripted::IsMoving ( )
inlinevirtual

Get whether the unit is moving.

Implements ICmpUnitMotion.

Definition at line 93 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::MoveToFormationOffset ( entity_id_t  target,
entity_pos_t  x,
entity_pos_t  z 
)
inlinevirtual

Join a formation, and move towards a given offset relative to the formation controller entity.

Continues following the formation until given a different command.

Implements ICmpUnitMotion.

Definition at line 68 of file ICmpUnitMotion.cpp.

virtual bool CCmpUnitMotionScripted::MoveToPointRange ( entity_pos_t  x,
entity_pos_t  z,
entity_pos_t  minRange,
entity_pos_t  maxRange 
)
inlinevirtual

Attempt to walk into range of a to a given point, or as close as possible.

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.

Definition at line 48 of file ICmpUnitMotion.cpp.

virtual bool CCmpUnitMotionScripted::MoveToTargetRange ( entity_id_t  target,
entity_pos_t  minRange,
entity_pos_t  maxRange 
)
inlinevirtual

Attempt to walk into range of a given target entity, or as close as possible.

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.

Definition at line 63 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::Serialize ( ISerializer serialize)
inlinevirtual

Implements IComponent.

Definition at line 46 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::SetDebugOverlay ( bool  enabled)
inlinevirtual

Toggle the rendering of debug info.

Implements ICmpUnitMotion.

Definition at line 123 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::SetFacePointAfterMove ( bool  facePointAfterMove)
inlinevirtual

Set whether the unit will turn to face the target point after finishing moving.

Implements ICmpUnitMotion.

Definition at line 108 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::SetSpeed ( fixed  speed)
inlinevirtual

Set the current movement speed.

Implements ICmpUnitMotion.

Definition at line 88 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::SetUnitRadius ( fixed  radius)
inlinevirtual

Override the default obstruction radius, used for planning paths and checking for collisions.

Bad things may happen if this entity has an active Obstruction component with a larger radius. (This is intended primarily for formation controllers.)

Implements ICmpUnitMotion.

Definition at line 118 of file ICmpUnitMotion.cpp.

virtual void CCmpUnitMotionScripted::StopMoving ( )
inlinevirtual

Stop moving immediately.

Implements ICmpUnitMotion.

Definition at line 78 of file ICmpUnitMotion.cpp.

Member Data Documentation

CComponentTypeScript CCmpUnitMotionScripted::m_Script
private

Definition at line 46 of file ICmpUnitMotion.cpp.


The documentation for this class was generated from the following file: