Pyrogenesis  trunk
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CCmpUnitMotionScripted Class Reference
Inheritance diagram for CCmpUnitMotionScripted:
Inheritance graph
[legend]
Collaboration diagram for CCmpUnitMotionScripted:
Collaboration graph
[legend]

Public Member Functions

 CCmpUnitMotionScripted (ScriptInterface &scriptInterface, JS::HandleValue 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 JS::Value GetJSInstance () const
 
virtual int GetComponentTypeId () 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) const
 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) const
 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 () const
 Get the current movement speed. More...
 
virtual void SetSpeed (fixed speed)
 Set the current movement speed. More...
 
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 void SetFacePointAfterMove (bool facePointAfterMove)
 Set whether the unit will turn to face the target point after finishing moving. 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 entity_pos_t GetUnitClearance () const
 Get the unit clearance (used by the Obstruction component) 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 bool NewJSObject (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 IComponentAllocate (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 u8 GetSerializationVersion ()
 

Private Attributes

CComponentTypeScript m_Script
 

Constructor & Destructor Documentation

CCmpUnitMotionScripted::CCmpUnitMotionScripted ( ScriptInterface scriptInterface,
JS::HandleValue  instance 
)
inline

Member Function Documentation

static IComponent* CCmpUnitMotionScripted::Allocate ( ScriptInterface scriptInterface,
JS::HandleValue  instance 
)
inlinestatic
static void CCmpUnitMotionScripted::ClassInit ( CComponentManager componentManager)
inlinestatic
static void CCmpUnitMotionScripted::Deallocate ( IComponent cmp)
inlinestatic
virtual void CCmpUnitMotionScripted::Deinit ( )
inlinevirtual

Implements IComponent.

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

Implements IComponent.

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

Turn to look towards the given point.

Implements ICmpUnitMotion.

virtual int CCmpUnitMotionScripted::GetComponentTypeId ( ) const
inlinevirtual

Implements IComponent.

virtual fixed CCmpUnitMotionScripted::GetCurrentSpeed ( ) const
inlinevirtual

Get the current movement speed.

Implements ICmpUnitMotion.

virtual JS::Value CCmpUnitMotionScripted::GetJSInstance ( ) const
inlinevirtual

Reimplemented from IComponent.

virtual pass_class_t CCmpUnitMotionScripted::GetPassabilityClass ( ) const
inlinevirtual

Get the unit's passability class.

Implements ICmpUnitMotion.

virtual std::string CCmpUnitMotionScripted::GetPassabilityClassName ( ) const
inlinevirtual

Get the passability class name (as defined in pathfinder.xml)

Implements ICmpUnitMotion.

virtual fixed CCmpUnitMotionScripted::GetRunSpeed ( ) const
inlinevirtual

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

Implements ICmpUnitMotion.

static std::string CCmpUnitMotionScripted::GetSchema ( )
inlinestatic
virtual entity_pos_t CCmpUnitMotionScripted::GetUnitClearance ( ) const
inlinevirtual

Get the unit clearance (used by the Obstruction component)

Implements ICmpUnitMotion.

virtual fixed CCmpUnitMotionScripted::GetWalkSpeed ( ) const
inlinevirtual

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

Implements ICmpUnitMotion.

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

Reimplemented from IComponent.

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

Implements IComponent.

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

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

Implements ICmpUnitMotion.

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

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

Implements ICmpUnitMotion.

virtual bool CCmpUnitMotionScripted::IsMoving ( ) const
inlinevirtual

Get whether the unit is moving.

Implements ICmpUnitMotion.

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.

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.

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.

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.

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.

virtual void CCmpUnitMotionScripted::Serialize ( ISerializer serialize)
inlinevirtual

Implements IComponent.

virtual void CCmpUnitMotionScripted::SetDebugOverlay ( bool  enabled)
inlinevirtual

Toggle the rendering of debug info.

Implements ICmpUnitMotion.

virtual void CCmpUnitMotionScripted::SetFacePointAfterMove ( bool  facePointAfterMove)
inlinevirtual

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

Implements ICmpUnitMotion.

virtual void CCmpUnitMotionScripted::SetSpeed ( fixed  speed)
inlinevirtual

Set the current movement speed.

Implements ICmpUnitMotion.

virtual void CCmpUnitMotionScripted::StopMoving ( )
inlinevirtual

Stop moving immediately.

Implements ICmpUnitMotion.

Member Data Documentation

CComponentTypeScript CCmpUnitMotionScripted::m_Script
private

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