载入中...
搜索中...
未找到
eve::rts::OrderComponent类 参考

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 第 390 行定义.

构造及析构函数说明

◆ OrderComponent() [1/3]

eve::rts::OrderComponent::OrderComponent ( )

在文件 RTSTypes.cpp 第 350 行定义.

◆ ~OrderComponent()

eve::rts::OrderComponent::~OrderComponent ( )
default

◆ OrderComponent() [2/3]

eve::rts::OrderComponent::OrderComponent ( const OrderComponent &  other)

在文件 RTSTypes.cpp 第 352 行定义.

◆ OrderComponent() [3/3]

eve::rts::OrderComponent::OrderComponent ( OrderComponent &&  other)
noexcept

在文件 RTSTypes.cpp 第 360 行定义.

成员函数说明

◆ 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 第 455 行定义.

引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::NotFound, eve::Status::success() , 以及 eve::Result< T >::success().

◆ clear()

void eve::rts::OrderComponent::clear ( )
noexcept

Remove active, queued, and retained order history.

在文件 RTSTypes.cpp 第 468 行定义.

◆ complete()

Result< void > eve::rts::OrderComponent::complete ( std::string_view  orderId)

◆ current()

Result< OrderRecord > eve::rts::OrderComponent::current ( ) const

Project the active order or return NotFound when idle.

在文件 RTSTypes.cpp 第 420 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), found, eve::NotFound, order , 以及 eve::Result< T >::success().

被这些函数引用 eve::rts::systems_internal::readCurrent().

◆ empty()

bool eve::rts::OrderComponent::empty ( ) const
noexcept

Return whether no order is currently retained.

在文件 RTSTypes.cpp 第 466 行定义.

◆ enqueue()

◆ fail()

Result< void > eve::rts::OrderComponent::fail ( std::string_view  orderId,
std::string_view  reason 
)

◆ operator=() [1/2]

OrderComponent & eve::rts::OrderComponent::operator= ( const OrderComponent &  other)

在文件 RTSTypes.cpp 第 354 行定义.

◆ operator=() [2/2]

OrderComponent & eve::rts::OrderComponent::operator= ( OrderComponent &&  other)
noexcept

在文件 RTSTypes.cpp 第 364 行定义.

◆ orderCount()

std::size_t eve::rts::OrderComponent::orderCount ( ) const
noexcept

Return the number of retained order records.

在文件 RTSTypes.cpp 第 476 行定义.

引用了 u.

◆ replace()

◆ restore()

Result< void > eve::rts::OrderComponent::restore ( std::string_view  json)

Transactionally restore the canonical generic queue.

在文件 RTSTypes.cpp 第 487 行定义.

引用了 eve::Applied, eve::orders::CommandQueue::restore(), eve::Status::success() , 以及 eve::Result< T >::success().

◆ restoreState()

Result< void > eve::rts::OrderComponent::restoreState ( const Snapshot &  snapshot)

◆ snapshot()

Result< std::string > eve::rts::OrderComponent::snapshot ( ) const

Serialize the canonical generic queue for persistence/replay.

在文件 RTSTypes.cpp 第 480 行定义.

引用了 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 第 499 行定义.

引用了 eve::Applied, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Status::success() , 以及 eve::Result< T >::success().

友元及相关函数文档

◆ CommandFanOutSystem

friend class CommandFanOutSystem
friend

在文件 RTSTypes.h 第 434 行定义.

◆ RTS

friend class RTS
friend

在文件 RTSTypes.h 第 433 行定义.

◆ RTSProductionActionAdapter

friend class RTSProductionActionAdapter
friend

在文件 RTSTypes.h 第 432 行定义.


该类的文档由以下文件生成: