Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/components/CCmpObstruction.cpp
/* Copyright (C) 2018 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 33 Lines | public: | ||||
DEFAULT_COMPONENT_ALLOCATOR(Obstruction) | DEFAULT_COMPONENT_ALLOCATOR(Obstruction) | ||||
typedef ICmpObstructionManager::tag_t tag_t; | typedef ICmpObstructionManager::tag_t tag_t; | ||||
typedef ICmpObstructionManager::flags_t flags_t; | typedef ICmpObstructionManager::flags_t flags_t; | ||||
// Template state: | // Template state: | ||||
enum { | EObstructionType m_Type; | ||||
STATIC, | |||||
UNIT, | |||||
CLUSTER | |||||
} m_Type; | |||||
entity_pos_t m_Size0; // radius or width | entity_pos_t m_Size0; // radius or width | ||||
entity_pos_t m_Size1; // radius or depth | entity_pos_t m_Size1; // radius or depth | ||||
flags_t m_TemplateFlags; | flags_t m_TemplateFlags; | ||||
entity_pos_t m_Clearance; | entity_pos_t m_Clearance; | ||||
typedef struct { | typedef struct { | ||||
entity_pos_t dx, dz; | entity_pos_t dx, dz; | ||||
▲ Show 20 Lines • Show All 393 Lines • ▼ Show 20 Lines | virtual void SetDisableBlockMovementPathfinding(bool movementDisabled, bool pathfindingDisabled, int32_t shape) | ||||
} | } | ||||
} | } | ||||
virtual bool GetBlockMovementFlag() const | virtual bool GetBlockMovementFlag() const | ||||
{ | { | ||||
return (m_TemplateFlags & ICmpObstructionManager::FLAG_BLOCK_MOVEMENT) != 0; | return (m_TemplateFlags & ICmpObstructionManager::FLAG_BLOCK_MOVEMENT) != 0; | ||||
} | } | ||||
virtual EObstructionType GetObstructionType() const | |||||
{ | |||||
return m_Type; | |||||
} | |||||
virtual ICmpObstructionManager::tag_t GetObstruction() const | virtual ICmpObstructionManager::tag_t GetObstruction() const | ||||
{ | { | ||||
return m_Tag; | return m_Tag; | ||||
} | } | ||||
virtual bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const | virtual bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const | ||||
{ | { | ||||
return GetObstructionSquare(out, true); | return GetObstructionSquare(out, true); | ||||
▲ Show 20 Lines • Show All 364 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator