Pyrogenesis  trunk
Public Types | Public Member Functions | List of all members
ICmpObstruction Class Referenceabstract

Flags an entity as obstructing movement for other units, and handles the processing of collision queries. More...

#include <ICmpObstruction.h>

Inheritance diagram for ICmpObstruction:
Inheritance graph
[legend]
Collaboration diagram for ICmpObstruction:
Collaboration graph
[legend]

Public Types

enum  EFoundationCheck {
  FOUNDATION_CHECK_SUCCESS, FOUNDATION_CHECK_FAIL_ERROR, FOUNDATION_CHECK_FAIL_NO_OBSTRUCTION, FOUNDATION_CHECK_FAIL_OBSTRUCTS_FOUNDATION,
  FOUNDATION_CHECK_FAIL_TERRAIN_CLASS
}
 

Public Member Functions

virtual ICmpObstructionManager::tag_t GetObstruction () const =0
 
virtual bool GetObstructionSquare (ICmpObstructionManager::ObstructionSquare &out) const =0
 Gets the square corresponding to this obstruction shape. More...
 
virtual bool GetPreviousObstructionSquare (ICmpObstructionManager::ObstructionSquare &out) const =0
 Same as the method above, but returns an obstruction shape for the previous turn. More...
 
virtual entity_pos_t GetSize () const =0
 
virtual entity_pos_t GetUnitRadius () const =0
 
virtual void SetUnitClearance (const entity_pos_t &clearance)=0
 
virtual bool IsControlPersistent () const =0
 
virtual EFoundationCheck CheckFoundation (const std::string &className) const =0
 Test whether this entity is colliding with any obstruction that are set to block the creation of foundations. More...
 
virtual EFoundationCheck CheckFoundation (const std::string &className, bool onlyCenterPoint) const =0
 
virtual std::string CheckFoundation_wrapper (const std::string &className, bool onlyCenterPoint) const
 CheckFoundation wrapper for script calls, to return friendly strings instead of an EFoundationCheck. More...
 
virtual bool CheckDuplicateFoundation () const =0
 Test whether this entity is colliding with any obstructions that share its control groups and block the creation of foundations. More...
 
virtual std::vector< entity_id_tGetUnitCollisions () const =0
 Returns a list of units that are colliding with this entity,. More...
 
virtual void ResolveFoundationCollisions () const =0
 Detects collisions between foundation-blocking entities and tries to fix them by setting control groups, if appropriate. More...
 
virtual void SetActive (bool active)=0
 
virtual void SetMovingFlag (bool enabled)=0
 
virtual void SetDisableBlockMovementPathfinding (bool movementDisabled, bool pathfindingDisabled, int32_t shape)=0
 
virtual bool GetBlockMovementFlag () const =0
 
virtual void SetControlGroup (entity_id_t group)=0
 Change the control group that the entity belongs to. More...
 
virtual entity_id_t GetControlGroup () const =0
 See SetControlGroup. More...
 
virtual void SetControlGroup2 (entity_id_t group2)=0
 
virtual entity_id_t GetControlGroup2 () const =0
 
- Public Member Functions inherited from IComponent
virtual ~IComponent ()
 
virtual void Init (const CParamNode &paramNode)=0
 
virtual void Deinit ()=0
 
virtual void HandleMessage (const CMessage &msg, bool global)
 
CEntityHandle GetEntityHandle () const
 
void SetEntityHandle (CEntityHandle ent)
 
entity_id_t GetEntityId () const
 
CEntityHandle GetSystemEntity () const
 
const CSimContextGetSimContext () const
 
void SetSimContext (const CSimContext &context)
 
virtual void Serialize (ISerializer &serialize)=0
 
virtual void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize)=0
 
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
 
virtual int GetComponentTypeId () const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static u8 GetSerializationVersion ()
 

Detailed Description

Flags an entity as obstructing movement for other units, and handles the processing of collision queries.

Member Enumeration Documentation

Enumerator
FOUNDATION_CHECK_SUCCESS 
FOUNDATION_CHECK_FAIL_ERROR 
FOUNDATION_CHECK_FAIL_NO_OBSTRUCTION 
FOUNDATION_CHECK_FAIL_OBSTRUCTS_FOUNDATION 
FOUNDATION_CHECK_FAIL_TERRAIN_CLASS 

Member Function Documentation

virtual bool ICmpObstruction::CheckDuplicateFoundation ( ) const
pure virtual

Test whether this entity is colliding with any obstructions that share its control groups and block the creation of foundations.

Returns
true if foundation is valid (not obstructed)

Implemented in CCmpObstruction.

virtual EFoundationCheck ICmpObstruction::CheckFoundation ( const std::string &  className) const
pure virtual

Test whether this entity is colliding with any obstruction that are set to block the creation of foundations.

Parameters
ignoredEntitiesList of entities to ignore during the test.
Returns
FOUNDATION_CHECK_SUCCESS if check passes, else an EFoundationCheck value describing the type of failure.

Implemented in CCmpObstruction.

virtual EFoundationCheck ICmpObstruction::CheckFoundation ( const std::string &  className,
bool  onlyCenterPoint 
) const
pure virtual

Implemented in CCmpObstruction.

std::string ICmpObstruction::CheckFoundation_wrapper ( const std::string &  className,
bool  onlyCenterPoint 
) const
virtual

CheckFoundation wrapper for script calls, to return friendly strings instead of an EFoundationCheck.

Returns
"success" if check passes, else a string describing the type of failure.
virtual bool ICmpObstruction::GetBlockMovementFlag ( ) const
pure virtual

Implemented in CCmpObstruction.

virtual entity_id_t ICmpObstruction::GetControlGroup ( ) const
pure virtual

See SetControlGroup.

Implemented in CCmpObstruction.

virtual entity_id_t ICmpObstruction::GetControlGroup2 ( ) const
pure virtual

Implemented in CCmpObstruction.

virtual ICmpObstructionManager::tag_t ICmpObstruction::GetObstruction ( ) const
pure virtual

Implemented in CCmpObstruction.

virtual bool ICmpObstruction::GetObstructionSquare ( ICmpObstructionManager::ObstructionSquare out) const
pure virtual

Gets the square corresponding to this obstruction shape.

Returns
true and updates out on success; false on failure (e.g. object not in the world).

Implemented in CCmpObstruction.

virtual bool ICmpObstruction::GetPreviousObstructionSquare ( ICmpObstructionManager::ObstructionSquare out) const
pure virtual

Same as the method above, but returns an obstruction shape for the previous turn.

Implemented in CCmpObstruction.

virtual entity_pos_t ICmpObstruction::GetSize ( ) const
pure virtual

Implemented in CCmpObstruction.

virtual std::vector<entity_id_t> ICmpObstruction::GetUnitCollisions ( ) const
pure virtual

Returns a list of units that are colliding with this entity,.

Returns
vector of blocking units

Implemented in CCmpObstruction.

virtual entity_pos_t ICmpObstruction::GetUnitRadius ( ) const
pure virtual

Implemented in CCmpObstruction.

virtual bool ICmpObstruction::IsControlPersistent ( ) const
pure virtual

Implemented in CCmpObstruction.

virtual void ICmpObstruction::ResolveFoundationCollisions ( ) const
pure virtual

Detects collisions between foundation-blocking entities and tries to fix them by setting control groups, if appropriate.

Implemented in CCmpObstruction.

virtual void ICmpObstruction::SetActive ( bool  active)
pure virtual

Implemented in CCmpObstruction.

virtual void ICmpObstruction::SetControlGroup ( entity_id_t  group)
pure virtual

Change the control group that the entity belongs to.

Control groups are used to let units ignore collisions with other units from the same group. Default is the entity's own ID.

Implemented in CCmpObstruction.

virtual void ICmpObstruction::SetControlGroup2 ( entity_id_t  group2)
pure virtual

Implemented in CCmpObstruction.

virtual void ICmpObstruction::SetDisableBlockMovementPathfinding ( bool  movementDisabled,
bool  pathfindingDisabled,
int32_t  shape 
)
pure virtual

Implemented in CCmpObstruction.

virtual void ICmpObstruction::SetMovingFlag ( bool  enabled)
pure virtual

Implemented in CCmpObstruction.

virtual void ICmpObstruction::SetUnitClearance ( const entity_pos_t clearance)
pure virtual

Implemented in CCmpObstruction.


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