Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpObstructionManager.h
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | public: | ||||
* Boolean flags affecting the obstruction behaviour of a shape. | * Boolean flags affecting the obstruction behaviour of a shape. | ||||
*/ | */ | ||||
enum EFlags | enum EFlags | ||||
{ | { | ||||
FLAG_BLOCK_MOVEMENT = (1 << 0), // prevents units moving through this shape | FLAG_BLOCK_MOVEMENT = (1 << 0), // prevents units moving through this shape | ||||
FLAG_BLOCK_FOUNDATION = (1 << 1), // prevents foundations being placed on this shape | FLAG_BLOCK_FOUNDATION = (1 << 1), // prevents foundations being placed on this shape | ||||
FLAG_BLOCK_CONSTRUCTION = (1 << 2), // prevents buildings being constructed on this shape | FLAG_BLOCK_CONSTRUCTION = (1 << 2), // prevents buildings being constructed on this shape | ||||
FLAG_BLOCK_PATHFINDING = (1 << 3), // prevents the tile pathfinder choosing paths through this shape | FLAG_BLOCK_PATHFINDING = (1 << 3), // prevents the tile pathfinder choosing paths through this shape | ||||
FLAG_MOVING = (1 << 4), // indicates this unit is currently moving | FLAG_MOVING = (1 << 4), // indicates this unit is currently moving | ||||
Stan: Can't it be renamed to FLAG_WANT_TO_MOVE? | |||||
Done Inline ActionsIt's not really WANT_TO_MOVE either. I could rename it to FLAG_PUSHING_PRIVATE or something but that doesn't seem really much better to me. wraitii: It's not really WANT_TO_MOVE either. I could rename it to FLAG_PUSHING_PRIVATE or something but… | |||||
Not Done Inline ActionsThen the comment might be adjusted no to say it can do more than having intention to move? Stan: Then the comment might be adjusted no to say it can do more than having intention to move? | |||||
FLAG_DELETE_UPON_CONSTRUCTION = (1 << 5) // this entity is deleted when construction of a building placed on top of this entity starts | FLAG_DELETE_UPON_CONSTRUCTION = (1 << 5) // this entity is deleted when construction of a building placed on top of this entity starts | ||||
}; | }; | ||||
/** | /** | ||||
* Bitmask of EFlag values. | * Bitmask of EFlag values. | ||||
*/ | */ | ||||
typedef u8 flags_t; | typedef u8 flags_t; | ||||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Check if the given shape is in range of the target shape given those parameters. | * Check if the given shape is in range of the target shape given those parameters. | ||||
* @param maxRange - if -1, treated as infinite. | * @param maxRange - if -1, treated as infinite. | ||||
*/ | */ | ||||
virtual bool AreShapesInRange(const ObstructionSquare& source, const ObstructionSquare& target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const = 0; | virtual bool AreShapesInRange(const ObstructionSquare& source, const ObstructionSquare& target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const = 0; | ||||
/** | /** | ||||
* Collision test a flat-ended thick line against the current set of shapes. | * Collision test a flat-ended thick line against the current set of static shapes. | ||||
* The line caps extend by @p r beyond the end points. | * The line caps extend by @p r beyond the end points. | ||||
* Only intersections going from outside to inside a shape are counted. | * Only intersections going from outside to inside a shape are counted. | ||||
* @param filter filter to restrict the shapes that are counted | * @param filter filter to restrict the shapes that are counted | ||||
* @param x0 X coordinate of line's first point | * @param x0 X coordinate of line's first point | ||||
* @param z0 Z coordinate of line's first point | * @param z0 Z coordinate of line's first point | ||||
* @param x1 X coordinate of line's second point | * @param x1 X coordinate of line's second point | ||||
* @param z1 Z coordinate of line's second point | * @param z1 Z coordinate of line's second point | ||||
* @param r radius (half width) of line | * @param r radius (half width) of line | ||||
* @param relaxClearanceForUnits whether unit-unit collisions should be more permissive. | |||||
* @return true if there is a collision | * @return true if there is a collision | ||||
*/ | */ | ||||
virtual bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, bool relaxClearanceForUnits) const = 0; | virtual bool TestStaticLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r) const = 0; | ||||
/** | /** | ||||
* Collision test a static square shape against the current set of shapes. | * Collision test a static square shape against the current set of shapes. | ||||
* @param filter filter to restrict the shapes that are being tested against | * @param filter filter to restrict the shapes that are being tested against | ||||
* @param x X coordinate of center | * @param x X coordinate of center | ||||
* @param z Z coordinate of center | * @param z Z coordinate of center | ||||
* @param a angle of rotation (clockwise from +Z direction) | * @param a angle of rotation (clockwise from +Z direction) | ||||
* @param w width (size along X axis) | * @param w width (size along X axis) | ||||
▲ Show 20 Lines • Show All 328 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Can't it be renamed to FLAG_WANT_TO_MOVE?