Warship module (eve.Warship).
更多...
#include <Warship.h>
Public 成员函数 | |
| Module_REG (Warship) | |
| Warship ()=default | |
| ~Warship () override=default | |
| Result< int > | registerHullsFromJson (const std::string &json) |
| Register hull templates from a JSON object or array. | |
| Result< int > | registerFunctionsFromJson (const std::string &json) |
| Register compartment function catalogue entries from JSON. | |
| void | clearHullDefinitions () |
| void | clearFunctionDefinitions () |
| bool | hasHullDefinition (const std::string &id) const |
| bool | hasFunctionDefinition (const std::string &id) const |
| int | getHullDefinitionCount () const |
| int | getFunctionDefinitionCount () const |
| std::string | getHullDefinitionCategory (const std::string &id) const |
| std::string | getHullDefinitionMobility (const std::string &id) const |
| Result< WarshipEntity * > | newWarship (const std::string &defId, float x, float y, float heading=0.f, const std::string &faction="") |
| Spawn a hull from a registered definition. @ownership ECS owns the entity; callers must not delete it. @lifetime Until ECS destroy / world teardown. @thread Owner ECS thread. @cost Allocates entity + grid cells; amortize across spawn actions. | |
| Result< void > | placeCompartment (WarshipEntity *ship, int deck, int row, int col, const std::string &functionId) |
| Result< void > | clearCompartment (WarshipEntity *ship, int deck, int row, int col) |
| Result< void > | swapCompartments (WarshipEntity *ship, int deckA, int rowA, int colA, int deckB, int rowB, int colB) |
| Result< void > | rearrangeFromJson (WarshipEntity *ship, const std::string &json) |
| int | getCompartmentCount (WarshipEntity *ship) const |
| int | getGridCols (WarshipEntity *ship) const |
| int | getGridRows (WarshipEntity *ship) const |
| int | getGridDecks (WarshipEntity *ship) const |
| std::string | getCompartmentFunction (WarshipEntity *ship, int deck, int row, int col) const |
| float | getPowerNet (WarshipEntity *ship) const |
| float | getThrustMul (WarshipEntity *ship) const |
| int | getHangarCapacity (WarshipEntity *ship) const |
| int | getWeaponBayCount (WarshipEntity *ship) const |
| int | getCrewCapacity (WarshipEntity *ship) const |
| float | getSailPower (WarshipEntity *ship) const |
| bool | isUnderpowered (WarshipEntity *ship) const |
| void | moveTo (WarshipEntity *ship, float x, float y) |
| void | stop (WarshipEntity *ship) |
| void | setInput (WarshipEntity *ship, float throttle, float steer) |
| void | update (float dt) |
| float | getX (WarshipEntity *ship) const |
| float | getY (WarshipEntity *ship) const |
| float | getHeading (WarshipEntity *ship) const |
| float | getSpeed (WarshipEntity *ship) const |
| float | getLength (WarshipEntity *ship) const |
| float | getBeam (WarshipEntity *ship) const |
| std::string | getId (WarshipEntity *ship) const |
| std::string | getDefId (WarshipEntity *ship) const |
| std::string | getCategory (WarshipEntity *ship) const |
| std::string | getFaction (WarshipEntity *ship) const |
| float | getHealth (WarshipEntity *ship) const |
| float | getMaxHealth (WarshipEntity *ship) const |
| bool | isArrived (WarshipEntity *ship) const |
| bool | isDestroyed (WarshipEntity *ship) const |
| void | applyDamage (WarshipEntity *ship, float amount) |
| void | clearEvents () |
| int | getEventCount () const |
| std::string | getEventType (int index) const |
| std::string | getEventWarshipId (int index) const |
| std::string | getEventDefId (int index) const |
| std::string | getEventDetail (int index) const |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
静态 Public 成员函数 | |
| static void | registerMobility (IWarshipMobility *mobility) |
| Register a custom mobility plugin (ownership transferred). | |
| static int | getMobilityCount () |
详细描述
构造及析构函数说明
◆ Warship()
|
default |
◆ ~Warship()
|
overridedefault |
成员函数说明
◆ applyDamage()
| void eve::warship::Warship::applyDamage | ( | WarshipEntity * | ship, |
| float | amount | ||
| ) |
在文件 Warship.cpp 第 255 行定义.
◆ clearCompartment()
| Result< void > eve::warship::Warship::clearCompartment | ( | WarshipEntity * | ship, |
| int | deck, | ||
| int | row, | ||
| int | col | ||
| ) |
在文件 Warship.cpp 第 141 行定义.
引用了 eve::warship::WarshipSystem::clearCompartment() , 以及 ok.
◆ clearEvents()
| void eve::warship::Warship::clearEvents | ( | ) |
在文件 Warship.cpp 第 260 行定义.
◆ clearFunctionDefinitions()
| void eve::warship::Warship::clearFunctionDefinitions | ( | ) |
在文件 Warship.cpp 第 73 行定义.
◆ clearHullDefinitions()
| void eve::warship::Warship::clearHullDefinitions | ( | ) |
在文件 Warship.cpp 第 71 行定义.
◆ getBeam()
| float eve::warship::Warship::getBeam | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 231 行定义.
◆ getCategory()
| std::string eve::warship::Warship::getCategory | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 239 行定义.
◆ getCompartmentCount()
| int eve::warship::Warship::getCompartmentCount | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 157 行定义.
◆ getCompartmentFunction()
| std::string eve::warship::Warship::getCompartmentFunction | ( | WarshipEntity * | ship, |
| int | deck, | ||
| int | row, | ||
| int | col | ||
| ) | const |
在文件 Warship.cpp 第 167 行定义.
引用了 index.
◆ getCrewCapacity()
| int eve::warship::Warship::getCrewCapacity | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 190 行定义.
◆ getDefId()
| std::string eve::warship::Warship::getDefId | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 235 行定义.
◆ getEventCount()
| int eve::warship::Warship::getEventCount | ( | ) | const |
在文件 Warship.cpp 第 262 行定义.
◆ getEventDefId()
| std::string eve::warship::Warship::getEventDefId | ( | int | index | ) | const |
在文件 Warship.cpp 第 274 行定义.
引用了 eve::warship::WarshipSystem::eventAt() , 以及 index.
◆ getEventDetail()
| std::string eve::warship::Warship::getEventDetail | ( | int | index | ) | const |
在文件 Warship.cpp 第 279 行定义.
引用了 eve::warship::WarshipSystem::eventAt() , 以及 index.
◆ getEventType()
| std::string eve::warship::Warship::getEventType | ( | int | index | ) | const |
在文件 Warship.cpp 第 264 行定义.
引用了 eve::warship::WarshipSystem::eventAt(), index , 以及 eve::warship::warshipEventTypeName().
◆ getEventWarshipId()
| std::string eve::warship::Warship::getEventWarshipId | ( | int | index | ) | const |
在文件 Warship.cpp 第 269 行定义.
引用了 eve::warship::WarshipSystem::eventAt() , 以及 index.
◆ getFaction()
| std::string eve::warship::Warship::getFaction | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 243 行定义.
◆ getFunctionDefinitionCount()
| int eve::warship::Warship::getFunctionDefinitionCount | ( | ) | const |
在文件 Warship.cpp 第 81 行定义.
◆ getGridCols()
| int eve::warship::Warship::getGridCols | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 161 行定义.
◆ getGridDecks()
| int eve::warship::Warship::getGridDecks | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 165 行定义.
◆ getGridRows()
| int eve::warship::Warship::getGridRows | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 163 行定义.
◆ getHangarCapacity()
| int eve::warship::Warship::getHangarCapacity | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 182 行定义.
◆ getHeading()
| float eve::warship::Warship::getHeading | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 225 行定义.
◆ getHealth()
| float eve::warship::Warship::getHealth | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 247 行定义.
◆ getHullDefinitionCategory()
| std::string eve::warship::Warship::getHullDefinitionCategory | ( | const std::string & | id | ) | const |
在文件 Warship.cpp 第 83 行定义.
引用了 eve::warship::WarshipDefinition::category , 以及 eve::warship::WarshipRegistry::findHull().
◆ getHullDefinitionCount()
| int eve::warship::Warship::getHullDefinitionCount | ( | ) | const |
在文件 Warship.cpp 第 79 行定义.
◆ getHullDefinitionMobility()
| std::string eve::warship::Warship::getHullDefinitionMobility | ( | const std::string & | id | ) | const |
在文件 Warship.cpp 第 88 行定义.
引用了 eve::warship::WarshipRegistry::findHull() , 以及 eve::warship::WarshipDefinition::mobility.
◆ getId()
| std::string eve::warship::Warship::getId | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 233 行定义.
◆ getLength()
| float eve::warship::Warship::getLength | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 229 行定义.
◆ getMaxHealth()
| float eve::warship::Warship::getMaxHealth | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 249 行定义.
◆ getMobilityCount()
|
static |
在文件 Warship.cpp 第 95 行定义.
◆ getPowerNet()
| float eve::warship::Warship::getPowerNet | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 174 行定义.
◆ getSailPower()
| float eve::warship::Warship::getSailPower | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 194 行定义.
◆ getSpeed()
| float eve::warship::Warship::getSpeed | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 227 行定义.
◆ getThrustMul()
| float eve::warship::Warship::getThrustMul | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 178 行定义.
◆ getWeaponBayCount()
| int eve::warship::Warship::getWeaponBayCount | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 186 行定义.
◆ getX()
| float eve::warship::Warship::getX | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 221 行定义.
◆ getY()
| float eve::warship::Warship::getY | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 223 行定义.
◆ hasFunctionDefinition()
| bool eve::warship::Warship::hasFunctionDefinition | ( | const std::string & | id | ) | const |
在文件 Warship.cpp 第 77 行定义.
◆ hasHullDefinition()
| bool eve::warship::Warship::hasHullDefinition | ( | const std::string & | id | ) | const |
在文件 Warship.cpp 第 75 行定义.
◆ isArrived()
| bool eve::warship::Warship::isArrived | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 251 行定义.
◆ isDestroyed()
| bool eve::warship::Warship::isDestroyed | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 253 行定义.
◆ isUnderpowered()
| bool eve::warship::Warship::isUnderpowered | ( | WarshipEntity * | ship | ) | const |
在文件 Warship.cpp 第 198 行定义.
◆ Module_REG()
| eve::warship::Warship::Module_REG | ( | Warship | ) |
◆ moveTo()
| void eve::warship::Warship::moveTo | ( | WarshipEntity * | ship, |
| float | x, | ||
| float | y | ||
| ) |
在文件 Warship.cpp 第 202 行定义.
引用了 eve::warship::WarshipSystem::moveTo(), x , 以及 y.
◆ newWarship()
| Result< WarshipEntity * > eve::warship::Warship::newWarship | ( | const std::string & | defId, |
| float | x, | ||
| float | y, | ||
| float | heading = 0.f, |
||
| const std::string & | faction = "" |
||
| ) |
Spawn a hull from a registered definition. @ownership ECS owns the entity; callers must not delete it. @lifetime Until ECS destroy / world teardown. @thread Owner ECS thread. @cost Allocates entity + grid cells; amortize across spawn actions.
在文件 Warship.cpp 第 97 行定义.
引用了 eve::warship::WarshipDefinition::beam, eve::warship::WarshipDefinition::category, eve::warship::CompartmentGrid::cellCount(), eve::warship::WarshipEntity::createWarship(), eve::warship::CompartmentGrid::decks, eve::warship::WarshipDefinition::defaultLayout, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::warship::WarshipRegistry::findHull(), eve::warship::WarshipDefinition::grid, eve::warship::WarshipRegistry::hasFunction(), heading, index, eve::InvalidArgument, eve::warship::WarshipDefinition::length, eve::warship::WarshipDefinition::maxHealth, eve::warship::WarshipSystem::recomputeCapabilities(), seed, eve::Result< T >::success(), x , 以及 y.
◆ placeCompartment()
| Result< void > eve::warship::Warship::placeCompartment | ( | WarshipEntity * | ship, |
| int | deck, | ||
| int | row, | ||
| int | col, | ||
| const std::string & | functionId | ||
| ) |
在文件 Warship.cpp 第 136 行定义.
引用了 ok , 以及 eve::warship::WarshipSystem::placeCompartment().
◆ rearrangeFromJson()
| Result< void > eve::warship::Warship::rearrangeFromJson | ( | WarshipEntity * | ship, |
| const std::string & | json | ||
| ) |
在文件 Warship.cpp 第 152 行定义.
引用了 ok , 以及 eve::warship::WarshipSystem::rearrangeFromJson().
◆ registerFunctionsFromJson()
| Result< int > eve::warship::Warship::registerFunctionsFromJson | ( | const std::string & | json | ) |
Register compartment function catalogue entries from JSON.
在文件 Warship.cpp 第 67 行定义.
◆ registerHullsFromJson()
| Result< int > eve::warship::Warship::registerHullsFromJson | ( | const std::string & | json | ) |
Register hull templates from a JSON object or array.
在文件 Warship.cpp 第 65 行定义.
◆ registerMobility()
|
static |
Register a custom mobility plugin (ownership transferred).
在文件 Warship.cpp 第 93 行定义.
◆ setInput()
| void eve::warship::Warship::setInput | ( | WarshipEntity * | ship, |
| float | throttle, | ||
| float | steer | ||
| ) |
在文件 Warship.cpp 第 212 行定义.
◆ stop()
| void eve::warship::Warship::stop | ( | WarshipEntity * | ship | ) |
在文件 Warship.cpp 第 207 行定义.
◆ swapCompartments()
| Result< void > eve::warship::Warship::swapCompartments | ( | WarshipEntity * | ship, |
| int | deckA, | ||
| int | rowA, | ||
| int | colA, | ||
| int | deckB, | ||
| int | rowB, | ||
| int | colB | ||
| ) |
在文件 Warship.cpp 第 146 行定义.
引用了 ok , 以及 eve::warship::WarshipSystem::swapCompartments().
◆ update()
| void eve::warship::Warship::update | ( | float | dt | ) |
在文件 Warship.cpp 第 219 行定义.
引用了 dt , 以及 eve::warship::WarshipSystem::update().
该类的文档由以下文件生成:
- src/modules/warship/Warship.h
- src/modules/warship/Warship.cpp
Public 成员函数 继承自