载入中...
搜索中...
未找到
eve::inventory::InventorySaveSession类 参考

Coordinates persistent inventory owners without duplicating their live state. 更多...

#include <InventorySaveSession.h>

类

class  PreparedRestore
 Validated owning inventory state awaiting publication. 更多...
 

Public 成员函数

 InventorySaveSession ()=default
 
void bind (Bag &bag, EquipmentSet &equipment) noexcept
 Bind the authoritative inventory participants.
 
eve::Result< std::string > snapshotJson () const
 Capture the complete bag and equipment state.
 
eve::Result< PreparedRestore > prepareRestoreSnapshotJson (std::string_view json) const
 Parse and validate a snapshot without mutating either participant.
 
void commitPrepared (PreparedRestore prepared) noexcept
 Publish a previously validated state without failure or callbacks.
 
eve::Result< void > restoreSnapshotJson (std::string_view json)
 Validate and atomically restore both bound inventory participants.
 

详细描述

Coordinates persistent inventory owners without duplicating their live state.

在文件 InventorySaveSession.h 第 22 行定义.

构造及析构函数说明

◆ InventorySaveSession()

eve::inventory::InventorySaveSession::InventorySaveSession ( )
default

成员函数说明

◆ bind()

void eve::inventory::InventorySaveSession::bind ( Bag &  bag,
EquipmentSet &  equipment 
)
noexcept

Bind the authoritative inventory participants.

参数
bagBorrowed bag owner.
equipmentBorrowed equipment owner.
备注
Both objects must outlive this session. Use on their owning simulation thread.

在文件 InventorySaveSession.cpp 第 145 行定义.

被这些函数引用 eve::rpg::RPGSaveSession::snapshotJson().

◆ commitPrepared()

void eve::inventory::InventorySaveSession::commitPrepared ( PreparedRestore  prepared)
noexcept

Publish a previously validated state without failure or callbacks.

参数
preparedOwning prepared state returned by this codec contract.
前置条件
The value has not previously been moved from or committed. @thread Owning simulation thread only. @reentrancy No callbacks or inventory hooks are invoked.

在文件 InventorySaveSession.cpp 第 302 行定义.

被这些函数引用 restoreSnapshotJson().

◆ prepareRestoreSnapshotJson()

eve::Result< InventorySaveSession::PreparedRestore > eve::inventory::InventorySaveSession::prepareRestoreSnapshotJson ( std::string_view  json) const

Parse and validate a snapshot without mutating either participant.

参数
jsonUTF-8 JSON produced by snapshotJson().
返回
Move-only prepared state, or a structured failure.
备注
Every referenced item definition and named policy must already be registered. @thread Owning simulation thread only. @reentrancy No callbacks or inventory hooks are invoked.

在文件 InventorySaveSession.cpp 第 196 行定义.

引用了 eve::Value::arraySize(), eve::Value::asInt(), eve::Value::asString(), eve::Value::at(), eve::Conflict, eve::inventory::InventorySystem::ensureBuiltins(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Value::find(), eve::Value::fromJson(), eve::inventory::InventorySystem::hasAcceptRule(), eve::inventory::InventorySystem::hasCapacityPolicy(), eve::inventory::InventorySystem::hasStackRule(), index, eve::InvalidArgument, eve::Value::isArray(), eve::Value::isInt64(), eve::Value::isNumeric(), eve::Value::isObject(), eve::Value::isString(), kind, name, eve::NotFound, number, eve::ParseError, eve::PreconditionViolation, root, slots, eve::Result< T >::success() , 以及 eve::UnknownVersion.

被这些函数引用 restoreSnapshotJson() , 以及 snapshotJson().

◆ restoreSnapshotJson()

eve::Result< void > eve::inventory::InventorySaveSession::restoreSnapshotJson ( std::string_view  json)

Validate and atomically restore both bound inventory participants.

参数
jsonUTF-8 JSON produced by snapshotJson().
返回
Applied status, or a structured failure with both participants unchanged.

在文件 InventorySaveSession.cpp 第 320 行定义.

引用了 eve::Applied, commitPrepared(), eve::Result< T >::failure(), prepareRestoreSnapshotJson(), eve::Status::success() , 以及 eve::Result< T >::success().

◆ snapshotJson()

eve::Result< std::string > eve::inventory::InventorySaveSession::snapshotJson ( ) const

Capture the complete bag and equipment state.

返回
Deterministic eve.inventory.save-session version 1 JSON, or a structured failure.
备注
Item definitions and runtime change events are external content/transient state and are excluded. @thread Owning simulation thread only. @reentrancy No callbacks or inventory hooks are invoked.

在文件 InventorySaveSession.cpp 第 150 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), name, eve::PreconditionViolation, prepareRestoreSnapshotJson(), root, slots , 以及 eve::Value::toJson().

被这些函数引用 eve::rpg::RPGSaveSession::snapshotJson().


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