18#ifndef INCLUDED_CCMPUNITMOTIONMANAGER
19#define INCLUDED_CCMPUNITMOTIONMANAGER
83 bool needUpdate =
false;
85 bool wentStraight =
false;
86 bool wasObstructed =
false;
89 bool isMoving =
false;
125 return "<a:component type='system'/><empty/>";
#define DEFAULT_COMPONENT_ALLOCATOR(cname)
Definition: Component.h:39
#define REGISTER_COMPONENT_TYPE(cname)
Definition: Component.h:32
Definition: CCmpUnitMotionManager.h:32
entity_pos_t m_StaticPushingSpread
Definition: CCmpUnitMotionManager.h:103
entity_pos_t m_MovingPushExtension
Definition: CCmpUnitMotionManager.h:98
void HandleMessage(const CMessage &msg, bool global) override
Definition: CCmpUnitMotion_System.cpp:133
void Deserialize(const CParamNode ¶mNode, IDeserializer &deserialize) override
Definition: CCmpUnitMotion_System.cpp:321
entity_pos_t m_PushingRadiusMultiplier
Definition: CCmpUnitMotionManager.h:96
static void ClassInit(CComponentManager &componentManager)
Definition: CCmpUnitMotion_System.cpp:120
void Push(EntityMap< MotionState >::value_type &a, EntityMap< MotionState >::value_type &b, fixed dt)
Definition: CCmpUnitMotion_System.cpp:645
entity_pos_t m_PushingPressureStrength
Definition: CCmpUnitMotionManager.h:109
static std::string GetSchema()
Definition: CCmpUnitMotionManager.h:123
void OnDeserialized()
This deserialization process is rather ugly, but it's required to store some data in the motion state...
Definition: CCmpUnitMotion_System.cpp:336
EntityMap< MotionState > m_Units
Definition: CCmpUnitMotionManager.h:115
bool IsPushingActivated() const override
Definition: CCmpUnitMotionManager.h:147
static constexpr int MAX_PRESSURE
Maximum value for pushing pressure.
Definition: CCmpUnitMotionManager.h:41
void Move(EntityMap< MotionState > &ents, fixed dt)
Definition: CCmpUnitMotion_System.cpp:406
void MoveUnits(fixed dt)
Definition: CCmpUnitMotion_System.cpp:396
void Serialize(ISerializer &serialize) override
Definition: CCmpUnitMotion_System.cpp:315
entity_pos_t m_MovingPushingSpread
Definition: CCmpUnitMotionManager.h:102
void MoveFormations(fixed dt)
Definition: CCmpUnitMotion_System.cpp:401
Grid< std::vector< EntityMap< MotionState >::iterator > > m_MovingUnits
Definition: CCmpUnitMotionManager.h:120
bool m_ComputingMotion
Definition: CCmpUnitMotionManager.h:121
void ResetSubdivisions()
Definition: CCmpUnitMotion_System.cpp:354
void Deinit() override
Definition: CCmpUnitMotionManager.h:130
entity_pos_t m_StaticPushExtension
Definition: CCmpUnitMotionManager.h:99
void Unregister(entity_id_t ent) override
Definition: CCmpUnitMotion_System.cpp:374
entity_pos_t m_PushingPressureDecay
Definition: CCmpUnitMotionManager.h:111
bool ComputingMotion() const override
True if entities are currently in the "Move" phase.
Definition: CCmpUnitMotionManager.h:142
void Register(CCmpUnitMotion *component, entity_id_t ent, bool formationController) override
Definition: CCmpUnitMotion_System.cpp:365
EntityMap< MotionState > m_FormationControllers
Definition: CCmpUnitMotionManager.h:116
entity_pos_t m_MinimalPushing
Definition: CCmpUnitMotionManager.h:106
void OnTurnStart()
Definition: CCmpUnitMotion_System.cpp:387
void Init(const CParamNode ¶mNode) override
Definition: CCmpUnitMotion_System.cpp:180
Definition: CCmpUnitMotion.h:133
Definition: ComponentManager.h:40
Definition: FixedVector2D.h:25
A simple fixed-point number class.
Definition: Fixed.h:120
static CFixed Zero()
Definition: Fixed.h:131
An entity initialisation parameter node.
Definition: ParamNode.h:151
A fast replacement for map<entity_id_t, T>.
Definition: EntityMap.h:32
Basic 2D array, intended for storing tile data, plus support for lazy updates by ICmpObstructionManag...
Definition: Grid.h:38
Represents an entity's position in the world (plus its orientation).
Definition: ICmpPosition.h:61
UnitMotionManager - handles motion for CCmpUnitMotion.
Definition: ICmpUnitMotionManager.h:31
Deserialization interface; see serialization overview.
Definition: IDeserializer.h:35
Serialization interface; see serialization overview.
Definition: ISerializer.h:121
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning.
Definition: code_annotation.h:40
const entity_id_t INVALID_ENTITY
Invalid entity ID.
Definition: Entity.h:35
u32 entity_id_t
Entity ID type.
Definition: Entity.h:29
Definition: CCmpUnitMotionManager.h:45
CFixedVector2D push
Definition: CCmpUnitMotionManager.h:62
ICmpPosition * cmpPosition
Definition: CCmpUnitMotionManager.h:53
fixed speed
Definition: CCmpUnitMotionManager.h:64
CFixedVector2D initialPos
Definition: CCmpUnitMotionManager.h:57
fixed angle
Definition: CCmpUnitMotionManager.h:67
CCmpUnitMotion * cmpUnitMotion
Definition: CCmpUnitMotionManager.h:54
fixed initialAngle
Definition: CCmpUnitMotionManager.h:66
CFixedVector2D pos
Definition: CCmpUnitMotionManager.h:59
Definition: EntityMap.h:40
unsigned char uint8_t
Definition: wposix_types.h:51