载入中...
搜索中...
未找到
TerrainSpawnPlan.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <variant>
6#include <vector>
7
8#include "common/Result.h"
15
16namespace eve::procgen {
17
26
37
47
57
67
77
81
88public:
90 [[nodiscard]] Result<int> addSplat(const std::string& ruleId, const Heightmap& paint, int targetLayer,
93 [[nodiscard]] Result<int> addDetail(const std::string& ruleId, const Heightmap& fitness,
96 std::int32_t seed);
98 [[nodiscard]] Result<int> addTrees(const std::string& ruleId, const Heightmap& fitness,
102 [[nodiscard]] Result<int> addObjects(const std::string& ruleId, const Heightmap& fitness,
106 [[nodiscard]] Result<int> addProbes(const std::string& ruleId, const Heightmap& fitness,
110 [[nodiscard]] Result<int> addModifierStamp(const std::string& ruleId, const Heightmap& stamp,
111 const TerrainStampSettings& operation, const Heightmap& localMask,
112 const Heightmap& globalMask);
114 [[nodiscard]] Result<void> setEnabled(const std::string& ruleId, bool enabled);
116 [[nodiscard]] int getRuleCount() const noexcept;
118 [[nodiscard]] const std::vector<TerrainSpawnRule>& rules() const noexcept;
120 [[nodiscard]] Result<std::string> snapshotJson() const;
122 [[nodiscard]] Result<void> restoreJson(const std::string& json);
123
124private:
125 [[nodiscard]] bool contains(const std::string& ruleId) const;
126 std::vector<TerrainSpawnRule> rules_;
127};
128
129} // namespace eve::procgen
ActionParameterOperation operation
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::uint32_t seed
Definition PointSet.cpp:807
Move-only, checked operation results for the common layer.
TerrainThermalSettings settings
Heightmap stamp
Move-only operation result carrying either a value or Status.
Definition Result.h:155
In-memory terrain heightmap: a dense float grid (row-major, index = y * width + x) materialized from ...
Definition Heightmap.h:21
Own an ordered mixed-domain Pcg-style spawn recipe. Rule IDs are stable and unique....
TerrainProbeOperationMode
Mutation performed by a multi-terrain probe rule.
TerrainDetailMode
Native detail-density operation corresponding to Pcg SpawnMode.
std::variant< TerrainSplatSpawnRule, TerrainDetailSpawnRule, TerrainTreeSpawnRule, TerrainObjectSpawnRule, TerrainProbeSpawnRule, TerrainModifierStampSpawnRule > TerrainSpawnRule
TerrainObjectOperationMode
Mutation performed by a multi-terrain game-object operation.
TerrainTreeOperationMode
Pcg SetTerrainTrees operation branch. Add and Replace both append after upstream clearing policy.
bool enabled
Effective detail rule settings; density is rule density times global spawn density.
One owned Pcg-style detail spawn rule.
One owned Pcg TerrainModifierStamp rule, including both ordered mask domains.
Deterministic Pcg SetTerrainGameObjects scan, collision and resource configuration.
One owned Pcg-style game-object spawn rule.
TerrainObjectPlacementSettings settings
TerrainObjectOperationMode mode
Deterministic value settings for Pcg SetProbes terrain scanning.
One owned Pcg-style reflection or light probe spawn rule.
TerrainProbePlacementSettings settings
One owned Pcg-style terrain texture spawn rule.
Value configuration for a rectangular stamp in world X/Z coordinates.
Explicit deterministic tree placement configuration for one terrain rectangle and resource.
One owned Pcg-style tree spawn rule.
TerrainTreePlacementSettings settings