载入中...
搜索中...
未找到
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 第 385 行定义.

构造及析构函数说明

◆ OrderComponent() [1/3]

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

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

◆ ~OrderComponent()

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

◆ OrderComponent() [2/3]

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

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

◆ OrderComponent() [3/3]

eve::rts::OrderComponent::OrderComponent ( OrderComponent &&  other)
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()

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

Remove active, queued, and retained order history.

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

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

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

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

◆ empty()

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

Return whether no order is currently retained.

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

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

◆ operator=() [2/2]

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

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

◆ orderCount()

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

Return the number of retained order records.

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

引用了 u.

◆ replace()

◆ 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()

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 第 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 class CommandFanOutSystem
friend

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

◆ RTS

friend class RTS
friend

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

◆ RTSProductionActionAdapter

friend class RTSProductionActionAdapter
friend

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


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