Pyrogenesis
trunk
|
Obstruction implementation. More...
Classes | |
struct | SerializeTag |
struct | Shape |
Public Types | |
enum | { STATIC, UNIT, CLUSTER } |
typedef ICmpObstructionManager::tag_t | tag_t |
typedef ICmpObstructionManager::flags_t | flags_t |
Public Types inherited from ICmpObstruction | |
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 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) |
virtual void | SetActive (bool active) |
virtual void | SetDisableBlockMovementPathfinding (bool movementDisabled, bool pathfindingDisabled, int32_t shape) |
virtual bool | GetBlockMovementFlag () const |
virtual ICmpObstructionManager::tag_t | GetObstruction () const |
virtual bool | GetPreviousObstructionSquare (ICmpObstructionManager::ObstructionSquare &out) const |
Same as the method above, but returns an obstruction shape for the previous turn. More... | |
virtual bool | GetObstructionSquare (ICmpObstructionManager::ObstructionSquare &out) const |
Gets the square corresponding to this obstruction shape. More... | |
virtual bool | GetObstructionSquare (ICmpObstructionManager::ObstructionSquare &out, bool previousPosition) const |
virtual entity_pos_t | GetUnitRadius () const |
virtual entity_pos_t | GetSize () const |
virtual void | SetUnitClearance (const entity_pos_t &clearance) |
virtual bool | IsControlPersistent () const |
virtual EFoundationCheck | CheckFoundation (const std::string &className) const |
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 |
virtual bool | CheckDuplicateFoundation () const |
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_t > | GetUnitCollisions () const |
Returns a list of units that are colliding with this entity,. More... | |
virtual void | SetMovingFlag (bool enabled) |
virtual void | SetControlGroup (entity_id_t group) |
Change the control group that the entity belongs to. More... | |
virtual void | SetControlGroup2 (entity_id_t group2) |
virtual entity_id_t | GetControlGroup () const |
See SetControlGroup. More... | |
virtual entity_id_t | GetControlGroup2 () const |
void | UpdateControlGroups () |
void | ResolveFoundationCollisions () const |
Detects collisions between foundation-blocking entities and tries to fix them by setting control groups, if appropriate. More... | |
Public Member Functions inherited from ICmpObstruction | |
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... | |
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 (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 |
Static Public Member Functions | |
static void | ClassInit (CComponentManager &componentManager) |
static IComponent * | Allocate (ScriptInterface &, JS::HandleValue) |
static void | Deallocate (IComponent *cmp) |
static std::string | GetSchema () |
Static Public Member Functions inherited from IComponent | |
static std::string | GetSchema () |
static u8 | GetSerializationVersion () |
Public Attributes | |
enum CCmpObstruction:: { ... } | m_Type |
entity_pos_t | m_Size0 |
entity_pos_t | m_Size1 |
flags_t | m_TemplateFlags |
entity_pos_t | m_Clearance |
std::vector< Shape > | m_Shapes |
bool | m_Active |
Whether the obstruction is actively obstructing or just an inactive placeholder. More... | |
bool | m_Moving |
Whether the entity associated with this obstruction is currently moving. More... | |
bool | m_ControlPersist |
Whether an obstruction's control group should be kept consistent and used to set control groups for entities that collide with it. More... | |
entity_id_t | m_ControlGroup |
Primary control group identifier. More... | |
entity_id_t | m_ControlGroup2 |
Optional secondary control group identifier. More... | |
tag_t | m_Tag |
Identifier of this entity's obstruction shape, as registered in the obstruction manager. More... | |
std::vector< tag_t > | m_ClusterTags |
flags_t | m_Flags |
Set of flags affecting the behaviour of this entity's obstruction shape. More... | |
Protected Member Functions | |
void | AddClusterShapes (entity_pos_t x, entity_pos_t z, entity_angle_t a) |
void | RemoveClusterShapes () |
Obstruction implementation.
This keeps the ICmpPathfinder's model of the world updated when the entities move and die, with shapes derived from ICmpFootprint.
|
inlineprotected |
|
inlinestatic |
|
inlinevirtual |
Test whether this entity is colliding with any obstructions that share its control groups and block the creation of foundations.
Implements ICmpObstruction.
|
inlinevirtual |
Test whether this entity is colliding with any obstruction that are set to block the creation of foundations.
ignoredEntities | List of entities to ignore during the test. |
Implements ICmpObstruction.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinestatic |
|
inlinestatic |
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
See SetControlGroup.
Implements ICmpObstruction.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
Gets the square corresponding to this obstruction shape.
out
on success; false on failure (e.g. object not in the world). Implements ICmpObstruction.
|
inlinevirtual |
|
inlinevirtual |
Same as the method above, but returns an obstruction shape for the previous turn.
Implements ICmpObstruction.
|
inlinestatic |
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
Returns a list of units that are colliding with this entity,.
Implements ICmpObstruction.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
Reimplemented from IComponent.
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlineprotected |
|
inlinevirtual |
Detects collisions between foundation-blocking entities and tries to fix them by setting control groups, if appropriate.
Implements ICmpObstruction.
|
inlinevirtual |
Implements IComponent.
|
inline |
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
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.
Implements ICmpObstruction.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
Implements ICmpObstruction.
|
inlinevirtual |
Implements ICmpObstruction.
|
inline |
bool CCmpObstruction::m_Active |
Whether the obstruction is actively obstructing or just an inactive placeholder.
entity_pos_t CCmpObstruction::m_Clearance |
std::vector<tag_t> CCmpObstruction::m_ClusterTags |
entity_id_t CCmpObstruction::m_ControlGroup |
Primary control group identifier.
Indicates to which control group this entity's shape belongs. Typically used in combination with obstruction test filters to have member shapes ignore each other during obstruction tests. Defaults to the entity's ID. Must never be set to INVALID_ENTITY.
entity_id_t CCmpObstruction::m_ControlGroup2 |
Optional secondary control group identifier.
Similar to m_ControlGroup; if set to a valid value, then this field identifies an additional, secondary control group to which this entity's shape belongs. Set to INVALID_ENTITY to not assign any secondary group. Defaults to INVALID_ENTITY.
These are only necessary in case it is not sufficient for an entity to belong to only one control group. Otherwise, they can be ignored.
bool CCmpObstruction::m_ControlPersist |
Whether an obstruction's control group should be kept consistent and used to set control groups for entities that collide with it.
flags_t CCmpObstruction::m_Flags |
Set of flags affecting the behaviour of this entity's obstruction shape.
bool CCmpObstruction::m_Moving |
Whether the entity associated with this obstruction is currently moving.
Only applicable for UNIT-type obstructions.
std::vector<Shape> CCmpObstruction::m_Shapes |
entity_pos_t CCmpObstruction::m_Size0 |
entity_pos_t CCmpObstruction::m_Size1 |
tag_t CCmpObstruction::m_Tag |
Identifier of this entity's obstruction shape, as registered in the obstruction manager.
Contains structure, but should be treated as opaque here.
flags_t CCmpObstruction::m_TemplateFlags |
enum { ... } CCmpObstruction::m_Type |