载入中...
搜索中...
未找到
ArtifactProvider.h
浏览该文件的文档.
1#pragma once
2
10
11#include <cstddef>
12#include <cstdint>
13#include <optional>
14#include <string>
15#include <vector>
16
17namespace eve::map {
18
23
27 std::string buildKey;
29 std::int32_t width = 0;
30 std::int32_t height = 0;
31 std::vector<std::uint32_t> cells;
32};
33
42public:
45 const eve::artifact::PublicationView& publication) override;
47 [[nodiscard]] eve::Result<eve::Value> snapshotState() const override;
49 [[nodiscard]] eve::Result<void> restoreState(const eve::Value& state) override;
51 [[nodiscard]] bool emptyState() const noexcept override { return records_.empty(); }
53 void clearState() noexcept override { clear(); }
54
64 [[nodiscard]] const MapArtifactRecord* find(eve::PersistentId id) const noexcept;
66 [[nodiscard]] std::optional<std::uint32_t> cell(eve::PersistentId id, std::int32_t x,
67 std::int32_t y) const noexcept;
69 [[nodiscard]] std::size_t size() const noexcept { return records_.size(); }
71 void clear() noexcept;
73 void setPrepareFailure(bool enabled) noexcept { failPrepare_ = enabled; }
74
75private:
76 friend class MapArtifactStage;
77 void commit(MapArtifactRecord record) noexcept;
78 std::vector<MapArtifactRecord> records_;
79 std::uint32_t nextIndex_ = 0;
80 bool failPrepare_ = false;
81};
82
87
88} // namespace eve::map
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
Low-level capability contracts for publishing backend-neutral artifacts.
#define EVENGINE_API_WORLD
Definition Export.h:109
Strong generation-qualified handles for non-ECS runtime registries.
Cell cell
Move-only operation result carrying either a value or Status.
Definition Result.h:155
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
Tile/map publication capability, implemented by the map module.
Id128 public API.
Definition Identity.h:112
Real map-module provider for generated grid publication.
bool emptyState() const noexcept override
Return whether the map registry has no committed records.
std::size_t size() const noexcept
Return the number of committed map artifact records.
void clearState() noexcept override
Clear provider state through the common restore-cleanup hook.
放置世界:格子占用(多通道)+ 地形语义 + 已放置建筑实例。 行为由 PlacementSystem 提供;本类暴露便于脚本绑定的薄封装方法。 坐标换算统一走 eve::grid(支持 rectang...
void registerMapArtifactProvider()
Register the map provider in the common capability registry.
MapArtifactProvider & mapArtifactProvider() noexcept
Return the process-owned map artifact provider singleton.
bool enabled
Borrowed immutable view of one complete generated publication.
Owner tag for map artifact runtime handles.
Queryable map record containing the copied semantic topology.
std::vector< std::uint32_t > cells