建筑放置模块(eve.Building)。 更多...
#include <Building.h>
Public 成员函数 | |
| Module_REG (Building) | |
| Building ()=default | |
| Building. | |
| ~Building () override=default | |
| Building. | |
| int | registerBuildingsFromJson (const std::string &json) |
| 从 JSON 注册建筑模板;返回成功注册数量。 | |
| void | clearBuildingDefinitions () |
| 清空全部建筑模板。 | |
| int | getBuildingDefinitionCount () |
| 已注册建筑模板数量。 | |
| bool | hasBuildingDefinition (const std::string &buildingId) |
| 建筑模板查询(显示名/类别/占地/规则/标签/额外属性/成本)。 | |
| std::string | getBuildingDisplayName (const std::string &buildingId) |
| Returns the building display name. | |
| std::string | getBuildingCategory (const std::string &buildingId) |
| Returns the building category. | |
| int | getBuildingFootprintW (const std::string &buildingId) |
| Returns the building footprint w. | |
| int | getBuildingFootprintH (const std::string &buildingId) |
| Returns the building footprint h. | |
| std::string | getBuildingSnapMode (const std::string &buildingId) |
| Returns the building snap mode. | |
| std::string | getBuildingRotationMode (const std::string &buildingId) |
| Returns the building rotation mode. | |
| std::string | getBuildingValidateRule (const std::string &buildingId) |
| Returns the building validate rule. | |
| std::string | getBuildingChannel (const std::string &buildingId) |
| Returns the building channel. | |
| std::string | getBuildingRenderMode (const std::string &buildingId) |
| Returns the building render mode. | |
| std::string | getBuildingPlacementKind (const std::string &buildingId) |
Definition placement domain (cell or edge). | |
| std::string | getBuildingConnectionGroup (const std::string &buildingId) |
| Definition edge connection group, or empty when it falls back to id. | |
| std::string | getBuildingVisual2d (const std::string &buildingId, const std::string &key, const std::string &fallback={}) |
| Returns the building visual 2 d. | |
| std::string | getBuildingVisual3d (const std::string &buildingId, const std::string &key, const std::string &fallback={}) |
| Returns the building visual 3 d. | |
| bool | buildingHasTag (const std::string &buildingId, const std::string &tag) |
| Building has tag. | |
| std::string | getBuildingExtra (const std::string &buildingId, const std::string &key, const std::string &fallback={}) |
| Returns the building extra. | |
| int | getBuildingCost (const std::string &buildingId, const std::string &resource) |
| Returns the building cost. | |
| PlacementWorld * | newWorld (int width, int height, float cellSize=32.f) |
| 工厂:创建放置世界 / 鬼影。 | |
| Ghost * | newGhost () |
| Creates a ghost. @ownership Caller deletes unless documented otherwise. | |
| PlacementSession * | newSession () |
| Creates a session. @ownership Caller deletes unless documented otherwise. | |
| bool | hasValidateRule (const std::string &name) |
| 扩展规则是否存在(校验/吸附)。 | |
| bool | hasSnapRule (const std::string &name) |
| True when snap rule. | |
| bool | hasSurface (const std::string &name) |
| True when surface. | |
| int | getSurfaceCount () |
| Returns the surface count. | |
| std::string | getSurfaceName (int index) |
| Returns the surface name. | |
| void | setPlaneSurfaceHeight (float h) |
| Sets the plane surface height. | |
| float | getPlaneSurfaceHeight () |
| Returns the plane surface height. | |
| void | clearChangeEvents () |
| 变更事件队列(放置/移除/移动)。 | |
| int | getChangeEventCount () const |
| Returns the change event count. | |
| std::string | getChangeEventAction (int index) const |
| Returns the change event action. | |
| std::string | getChangeEventWorldId (int index) const |
| Returns the change event world id. | |
| std::string | getChangeEventBuildingId (int index) const |
| Returns the change event building id. | |
| int | getChangeEventInstanceId (int index) const |
| Returns the change event instance id. | |
| int | getChangeEventCellX (int index) const |
| Returns the change event cell x. | |
| int | getChangeEventCellY (int index) const |
| Returns the change event cell y. | |
| int | getChangeEventOtherCellX (int index) const |
| Returns the change event other cell x. | |
| int | getChangeEventOtherCellY (int index) const |
| Returns the change event other cell y. | |
| float | getChangeEventRotation (int index) const |
| Returns the change event rotation. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
建筑放置模块(eve.Building)。
在文件 Building.h 第 20 行定义.
构造及析构函数说明
◆ Building()
|
default |
◆ ~Building()
|
overridedefault |
成员函数说明
◆ buildingHasTag()
| bool eve::building::Building::buildingHasTag | ( | const std::string & | buildingId, |
| const std::string & | tag | ||
| ) |
◆ clearBuildingDefinitions()
| void eve::building::Building::clearBuildingDefinitions | ( | ) |
◆ clearChangeEvents()
| void eve::building::Building::clearChangeEvents | ( | ) |
◆ getBuildingCategory()
| std::string eve::building::Building::getBuildingCategory | ( | const std::string & | buildingId | ) |
Returns the building category.
在文件 Building.cpp 第 29 行定义.
◆ getBuildingChannel()
| std::string eve::building::Building::getBuildingChannel | ( | const std::string & | buildingId | ) |
Returns the building channel.
在文件 Building.cpp 第 59 行定义.
◆ getBuildingConnectionGroup()
| std::string eve::building::Building::getBuildingConnectionGroup | ( | const std::string & | buildingId | ) |
Definition edge connection group, or empty when it falls back to id.
在文件 Building.cpp 第 74 行定义.
◆ getBuildingCost()
| int eve::building::Building::getBuildingCost | ( | const std::string & | buildingId, |
| const std::string & | resource | ||
| ) |
Returns the building cost.
在文件 Building.cpp 第 102 行定义.
◆ getBuildingDefinitionCount()
| int eve::building::Building::getBuildingDefinitionCount | ( | ) |
◆ getBuildingDisplayName()
| std::string eve::building::Building::getBuildingDisplayName | ( | const std::string & | buildingId | ) |
Returns the building display name.
在文件 Building.cpp 第 24 行定义.
◆ getBuildingExtra()
| std::string eve::building::Building::getBuildingExtra | ( | const std::string & | buildingId, |
| const std::string & | key, | ||
| const std::string & | fallback = {} |
||
| ) |
Returns the building extra.
在文件 Building.cpp 第 96 行定义.
引用了 eve::building::BuildingRegistry::find() , 以及 key.
◆ getBuildingFootprintH()
| int eve::building::Building::getBuildingFootprintH | ( | const std::string & | buildingId | ) |
Returns the building footprint h.
在文件 Building.cpp 第 39 行定义.
◆ getBuildingFootprintW()
| int eve::building::Building::getBuildingFootprintW | ( | const std::string & | buildingId | ) |
Returns the building footprint w.
在文件 Building.cpp 第 34 行定义.
◆ getBuildingPlacementKind()
| std::string eve::building::Building::getBuildingPlacementKind | ( | const std::string & | buildingId | ) |
Definition placement domain (cell or edge).
在文件 Building.cpp 第 69 行定义.
◆ getBuildingRenderMode()
| std::string eve::building::Building::getBuildingRenderMode | ( | const std::string & | buildingId | ) |
Returns the building render mode.
在文件 Building.cpp 第 64 行定义.
◆ getBuildingRotationMode()
| std::string eve::building::Building::getBuildingRotationMode | ( | const std::string & | buildingId | ) |
Returns the building rotation mode.
在文件 Building.cpp 第 49 行定义.
◆ getBuildingSnapMode()
| std::string eve::building::Building::getBuildingSnapMode | ( | const std::string & | buildingId | ) |
Returns the building snap mode.
在文件 Building.cpp 第 44 行定义.
◆ getBuildingValidateRule()
| std::string eve::building::Building::getBuildingValidateRule | ( | const std::string & | buildingId | ) |
Returns the building validate rule.
在文件 Building.cpp 第 54 行定义.
◆ getBuildingVisual2d()
| std::string eve::building::Building::getBuildingVisual2d | ( | const std::string & | buildingId, |
| const std::string & | key, | ||
| const std::string & | fallback = {} |
||
| ) |
Returns the building visual 2 d.
在文件 Building.cpp 第 79 行定义.
引用了 eve::building::BuildingRegistry::find() , 以及 key.
◆ getBuildingVisual3d()
| std::string eve::building::Building::getBuildingVisual3d | ( | const std::string & | buildingId, |
| const std::string & | key, | ||
| const std::string & | fallback = {} |
||
| ) |
Returns the building visual 3 d.
在文件 Building.cpp 第 85 行定义.
引用了 eve::building::BuildingRegistry::find() , 以及 key.
◆ getChangeEventAction()
| std::string eve::building::Building::getChangeEventAction | ( | int | index | ) | const |
Returns the change event action.
在文件 Building.cpp 第 152 行定义.
◆ getChangeEventBuildingId()
| std::string eve::building::Building::getChangeEventBuildingId | ( | int | index | ) | const |
Returns the change event building id.
在文件 Building.cpp 第 164 行定义.
◆ getChangeEventCellX()
| int eve::building::Building::getChangeEventCellX | ( | int | index | ) | const |
Returns the change event cell x.
在文件 Building.cpp 第 176 行定义.
◆ getChangeEventCellY()
| int eve::building::Building::getChangeEventCellY | ( | int | index | ) | const |
Returns the change event cell y.
在文件 Building.cpp 第 182 行定义.
◆ getChangeEventCount()
| int eve::building::Building::getChangeEventCount | ( | ) | const |
Returns the change event count.
在文件 Building.cpp 第 150 行定义.
引用了 eve::building::PlacementSystem::events() , 以及 size.
◆ getChangeEventInstanceId()
| int eve::building::Building::getChangeEventInstanceId | ( | int | index | ) | const |
Returns the change event instance id.
在文件 Building.cpp 第 170 行定义.
◆ getChangeEventOtherCellX()
| int eve::building::Building::getChangeEventOtherCellX | ( | int | index | ) | const |
Returns the change event other cell x.
在文件 Building.cpp 第 188 行定义.
◆ getChangeEventOtherCellY()
| int eve::building::Building::getChangeEventOtherCellY | ( | int | index | ) | const |
Returns the change event other cell y.
在文件 Building.cpp 第 194 行定义.
◆ getChangeEventRotation()
| float eve::building::Building::getChangeEventRotation | ( | int | index | ) | const |
Returns the change event rotation.
在文件 Building.cpp 第 200 行定义.
◆ getChangeEventWorldId()
| std::string eve::building::Building::getChangeEventWorldId | ( | int | index | ) | const |
Returns the change event world id.
在文件 Building.cpp 第 158 行定义.
◆ getPlaneSurfaceHeight()
| float eve::building::Building::getPlaneSurfaceHeight | ( | ) |
Returns the plane surface height.
在文件 Building.cpp 第 146 行定义.
引用了 eve::building::PlacementSystem::getPlaneSurfaceHeight().
◆ getSurfaceCount()
| int eve::building::Building::getSurfaceCount | ( | ) |
Returns the surface count.
在文件 Building.cpp 第 134 行定义.
引用了 size , 以及 eve::building::PlacementSystem::surfaceNames().
◆ getSurfaceName()
| std::string eve::building::Building::getSurfaceName | ( | int | index | ) |
Returns the surface name.
在文件 Building.cpp 第 138 行定义.
引用了 index , 以及 eve::building::PlacementSystem::surfaceNames().
◆ hasBuildingDefinition()
| bool eve::building::Building::hasBuildingDefinition | ( | const std::string & | buildingId | ) |
建筑模板查询(显示名/类别/占地/规则/标签/额外属性/成本)。
在文件 Building.cpp 第 20 行定义.
◆ hasSnapRule()
| bool eve::building::Building::hasSnapRule | ( | const std::string & | name | ) |
◆ hasSurface()
| bool eve::building::Building::hasSurface | ( | const std::string & | name | ) |
◆ hasValidateRule()
| bool eve::building::Building::hasValidateRule | ( | const std::string & | name | ) |
◆ Module_REG()
| eve::building::Building::Module_REG | ( | Building | ) |
◆ newGhost()
| Ghost * eve::building::Building::newGhost | ( | ) |
Creates a ghost. @ownership Caller deletes unless documented otherwise.
在文件 Building.cpp 第 112 行定义.
◆ newSession()
| PlacementSession * eve::building::Building::newSession | ( | ) |
Creates a session. @ownership Caller deletes unless documented otherwise.
在文件 Building.cpp 第 117 行定义.
◆ newWorld()
| PlacementWorld * eve::building::Building::newWorld | ( | int | width, |
| int | height, | ||
| float | cellSize = 32.f |
||
| ) |
工厂:创建放置世界 / 鬼影。
在文件 Building.cpp 第 107 行定义.
引用了 eve::building::PlacementSystem::ensureBuiltins(), height , 以及 width.
◆ registerBuildingsFromJson()
| int eve::building::Building::registerBuildingsFromJson | ( | const std::string & | json | ) |
从 JSON 注册建筑模板;返回成功注册数量。
在文件 Building.cpp 第 11 行定义.
引用了 eve::building::PlacementSystem::ensureBuiltins() , 以及 eve::building::BuildingRegistry::loadFromJson().
◆ setPlaneSurfaceHeight()
| void eve::building::Building::setPlaneSurfaceHeight | ( | float | h | ) |
Sets the plane surface height.
在文件 Building.cpp 第 144 行定义.
引用了 h , 以及 eve::building::PlacementSystem::setPlaneSurfaceHeight().
该类的文档由以下文件生成:
- src/modules/building/Building.h
- src/modules/building/Building.cpp
Public 成员函数 继承自