载入中...
搜索中...
未找到
PcgTerrainWatcher.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
4
5#include <string>
6#include <vector>
7
8namespace eve::procgen {
9
11enum class PcgTerrainChangeType { Created = 0, Removed = 1 };
12
18
31public:
33 void beginScan();
35 [[nodiscard]] Result<int> addTerrain(const std::string& terrainId);
37 [[nodiscard]] Result<int> commitScan();
39 void cancelScan();
41 int getTerrainCount() const noexcept;
43 int getChangeCount() const noexcept;
45 [[nodiscard]] Result<std::string> getChangeTerrainId(int index) const;
47 [[nodiscard]] Result<int> getChangeType(int index) const;
48
49private:
50 bool initialized_ = false;
51 bool scanning_ = false;
52 std::vector<std::string> terrains_;
53 std::vector<std::string> candidate_;
54 std::vector<PcgTerrainChange> changes_;
55};
56
57} // namespace eve::procgen
#define EVENGINE_API_DOMAINS
Definition Export.h:110
Move-only, checked operation results for the common layer.
uint32_t index
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Deterministic, caller-driven equivalent of PcgTerrainWatcher's hierarchy diff.
PcgTerrainChangeType
Pcg terrain hierarchy change kind.
One copied terrain identity and its change kind.