Generic orders component adapter; the queue remains the sole order owner. 更多...
#include <RTSTypes.h>
类 | |
| struct | Impl |
| struct | Snapshot |
| Complete RTS order projection snapshot; entity handles must be rebound by the owning domain. 更多... | |
Public 成员函数 | |
| OrderComponent () | |
| ~OrderComponent () | |
| OrderComponent (const OrderComponent &other) | |
| OrderComponent & | operator= (const OrderComponent &other) |
| OrderComponent (OrderComponent &&other) noexcept | |
| OrderComponent & | operator= (OrderComponent &&other) noexcept |
| Result< std::string > | enqueue (const CommandSpec &command, int formationSlot=-1) |
| Append a Move/Attack/Build/Gather command. | |
| Result< std::string > | replace (const CommandSpec &command, int formationSlot=-1) |
| Replace unfinished commands with one new command. | |
| Result< OrderRecord > | current () const |
| Project the active order or return NotFound when idle. | |
| Result< void > | complete (std::string_view orderId) |
| Complete the active order by its stable queue id. | |
| Result< void > | fail (std::string_view orderId, std::string_view reason) |
| Fail the active order by its stable queue id. | |
| Result< void > | cancel (std::string_view orderId, std::string_view reason) |
| Cancel an active or queued order by its stable queue id. | |
| bool | empty () const noexcept |
| Return whether no order is currently retained. | |
| void | clear () noexcept |
| Remove active, queued, and retained order history. | |
| std::size_t | orderCount () const noexcept |
| Return the number of retained order records. | |
| Result< std::string > | snapshot () const |
| Serialize the canonical generic queue for persistence/replay. | |
| Result< void > | restore (std::string_view json) |
| Transactionally restore the canonical generic queue. | |
| Result< Snapshot > | snapshotState () const |
| Capture the generic queue and every RTS-specific payload atomically. | |
| Result< void > | restoreState (const Snapshot &snapshot) |
| Transactionally restore a complete RTS order projection. | |
友元 | |
| class | RTSProductionActionAdapter |
| class | RTS |
| class | CommandFanOutSystem |
详细描述
Generic orders component adapter; the queue remains the sole order owner.
在文件 RTSTypes.h 第 385 行定义.
构造及析构函数说明
◆ OrderComponent() [1/3]
| eve::rts::OrderComponent::OrderComponent | ( | ) |
在文件 RTSTypes.cpp 第 349 行定义.
◆ ~OrderComponent()
|
default |
◆ OrderComponent() [2/3]
| eve::rts::OrderComponent::OrderComponent | ( | const OrderComponent & | other | ) |
在文件 RTSTypes.cpp 第 351 行定义.
◆ OrderComponent() [3/3]
|
noexcept |
在文件 RTSTypes.cpp 第 359 行定义.
成员函数说明
◆ cancel()
| Result< void > eve::rts::OrderComponent::cancel | ( | std::string_view | orderId, |
| std::string_view | reason | ||
| ) |
Cancel an active or queued order by its stable queue id.
在文件 RTSTypes.cpp 第 449 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::NotFound, eve::Status::success() , 以及 eve::Result< T >::success().
◆ clear()
|
noexcept |
Remove active, queued, and retained order history.
在文件 RTSTypes.cpp 第 462 行定义.
◆ complete()
| Result< void > eve::rts::OrderComponent::complete | ( | std::string_view | orderId | ) |
Complete the active order by its stable queue id.
在文件 RTSTypes.cpp 第 428 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::NotFound, eve::Status::success() , 以及 eve::Result< T >::success().
◆ current()
| Result< OrderRecord > eve::rts::OrderComponent::current | ( | ) | const |
Project the active order or return NotFound when idle.
在文件 RTSTypes.cpp 第 419 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), found, eve::NotFound , 以及 order.
◆ empty()
|
noexcept |
Return whether no order is currently retained.
在文件 RTSTypes.cpp 第 460 行定义.
◆ enqueue()
| Result< std::string > eve::rts::OrderComponent::enqueue | ( | const CommandSpec & | command, |
| int | formationSlot = -1 |
||
| ) |
Append a Move/Attack/Build/Gather command.
在文件 RTSTypes.cpp 第 372 行定义.
引用了 eve::rts::CommandSpec::append, eve::Applied, eve::rts::CommandSpec::definitionId, eve::Diagnostic::error(), eve::Result< T >::failure(), id, eve::InvariantViolation, eve::rts::CommandSpec::kind, order, eve::rts::orderKindName(), eve::rts::CommandSpec::priority, queued, eve::rts::CommandSpec::radius, eve::rts::CommandSpec::secondaryTarget, eve::Status::success(), eve::Result< T >::success(), eve::rts::CommandSpec::target, eve::rts::CommandSpec::timeoutSeconds, valid, eve::rts::CommandSpec::validate(), eve::rts::WorldPosition::x , 以及 eve::rts::WorldPosition::y.
◆ fail()
| Result< void > eve::rts::OrderComponent::fail | ( | std::string_view | orderId, |
| std::string_view | reason | ||
| ) |
Fail the active order by its stable queue id.
在文件 RTSTypes.cpp 第 438 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::NotFound, eve::Status::success() , 以及 eve::Result< T >::success().
◆ operator=() [1/2]
| OrderComponent & eve::rts::OrderComponent::operator= | ( | const OrderComponent & | other | ) |
在文件 RTSTypes.cpp 第 353 行定义.
◆ operator=() [2/2]
|
noexcept |
在文件 RTSTypes.cpp 第 363 行定义.
◆ orderCount()
|
noexcept |
◆ replace()
| Result< std::string > eve::rts::OrderComponent::replace | ( | const CommandSpec & | command, |
| int | formationSlot = -1 |
||
| ) |
Replace unfinished commands with one new command.
在文件 RTSTypes.cpp 第 395 行定义.
引用了 eve::rts::CommandSpec::append, eve::Applied, eve::rts::CommandSpec::definitionId, eve::Diagnostic::error(), eve::Result< T >::failure(), id, eve::InvariantViolation, eve::rts::CommandSpec::kind, order, eve::rts::orderKindName(), eve::rts::CommandSpec::priority, queued, eve::rts::CommandSpec::radius, eve::rts::CommandSpec::secondaryTarget, eve::Status::success(), eve::Result< T >::success(), eve::rts::CommandSpec::target, eve::rts::CommandSpec::timeoutSeconds, valid, eve::rts::CommandSpec::validate(), eve::rts::WorldPosition::x , 以及 eve::rts::WorldPosition::y.
◆ restore()
| Result< void > eve::rts::OrderComponent::restore | ( | std::string_view | json | ) |
Transactionally restore the canonical generic queue.
在文件 RTSTypes.cpp 第 480 行定义.
引用了 eve::Applied, eve::orders::CommandQueue::restore(), eve::Status::success() , 以及 eve::Result< T >::success().
◆ restoreState()
Transactionally restore a complete RTS order projection.
在文件 RTSTypes.cpp 第 501 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::rts::OrderComponent::Snapshot::extended, eve::orders::CommandQueue::find(), eve::rts::OrderComponent::Snapshot::queueJson, eve::orders::CommandQueue::restore(), eve::Status::success(), eve::Result< T >::success() , 以及 valid.
被这些函数引用 eve::rts::RTS::restoreState().
◆ snapshot()
| Result< std::string > eve::rts::OrderComponent::snapshot | ( | ) | const |
Serialize the canonical generic queue for persistence/replay.
在文件 RTSTypes.cpp 第 473 行定义.
引用了 eve::Diagnostic::error(), eve::Failed , 以及 eve::Result< T >::failure().
◆ snapshotState()
| Result< OrderComponent::Snapshot > eve::rts::OrderComponent::snapshotState | ( | ) | const |
Capture the generic queue and every RTS-specific payload atomically.
在文件 RTSTypes.cpp 第 491 行定义.
引用了 eve::Applied, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::success() , 以及 eve::Result< T >::success().
友元及相关函数文档
◆ CommandFanOutSystem
|
friend |
在文件 RTSTypes.h 第 429 行定义.
◆ RTS
|
friend |
在文件 RTSTypes.h 第 428 行定义.
◆ RTSProductionActionAdapter
|
friend |
在文件 RTSTypes.h 第 427 行定义.
该类的文档由以下文件生成:
- src/modules/rts/RTSTypes.h
- src/modules/rts/RTSTypes.cpp