载入中...
搜索中...
未找到
InventorySaveSession.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
10#include "common/Result.h"
11
12#include <memory>
13#include <string>
14#include <string_view>
15
16namespace eve::inventory {
17
18class Bag;
19class EquipmentSet;
20
23public:
29 public:
35 PreparedRestore &operator=(PreparedRestore &&) noexcept;
37 PreparedRestore &operator=(const PreparedRestore &) = delete;
38
39 private:
41
43 std::unique_ptr<Bag> bag_;
44 std::unique_ptr<EquipmentSet> equipment_;
45 int largestInstanceId = 0;
46 };
47
49
56 void bind(Bag &bag, EquipmentSet &equipment) noexcept;
57
65 [[nodiscard]] eve::Result<std::string> snapshotJson() const;
66
75 [[nodiscard]] eve::Result<PreparedRestore> prepareRestoreSnapshotJson(std::string_view json) const;
76
84 void commitPrepared(PreparedRestore prepared) noexcept;
85
91 [[nodiscard]] eve::Result<void> restoreSnapshotJson(std::string_view json);
92
93private:
94 Bag *bag_ = nullptr;
95 EquipmentSet *equipment_ = nullptr;
96};
97
98} // namespace eve::inventory
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
格子型物品容器(脚本可直接操作)。
Definition Bag.h:21
EVENGINE_API_FOUNDATION public API.
Definition Equipment.h:19
Validated owning inventory state awaiting publication.
PreparedRestore(PreparedRestore &&) noexcept
Prepared restore.
Coordinates persistent inventory owners without duplicating their live state.
运行时容器:固定格数的背包 / 箱子 / 商店栏等。 行为由 InventorySystem 提供;本类暴露便于脚本绑定的薄封装方法。
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16