载入中...
搜索中...
未找到
PcgRuntimeStamper.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
5
6#include <string>
7
8namespace eve::procgen {
9
11enum class PcgRuntimeStampStatus { Idle = 0, AwaitingResource = 1, Loaded = 2, Completed = 3, Failed = 4 };
12
20public:
22 [[nodiscard]] Result<void> configure(std::string stampAddress, bool showGui = true, bool showDebug = true);
24 [[nodiscard]] Result<void> loadStamp(const Heightmap& stamp, const std::string& resourceName);
26 [[nodiscard]] Result<void> reportMissingStamp();
28 [[nodiscard]] Result<int> execute(Heightmap& target, double originX = 0.0, double originZ = 0.0,
29 double spacingX = 1.0, double spacingZ = 1.0);
31 [[nodiscard]] Result<void> updateLayout(double screenWidth, double screenHeight);
32
34 [[nodiscard]] const std::string& stampAddress() const noexcept { return address_; }
36 [[nodiscard]] const std::string& progressText() const noexcept { return progress_; }
38 [[nodiscard]] PcgRuntimeStampStatus status() const noexcept { return status_; }
40 [[nodiscard]] double updateTimeAllowed() const noexcept { return 1.0 / 15.0; }
42 [[nodiscard]] double labelCenterX() const noexcept { return labelX_; }
44 [[nodiscard]] double labelCenterY() const noexcept { return labelY_; }
45
46private:
47 std::string address_ = "Pcg/Stamps/RuggedHills 1810 4";
48 std::string progress_;
49 Heightmap stamp_;
50 PcgRuntimeStampStatus status_ = PcgRuntimeStampStatus::Idle;
51 bool showGui_ = true;
52 bool showDebug_ = true;
53 double labelX_ = 150.0;
54 double labelY_ = 10.0;
55};
56
57} // namespace eve::procgen
LogicalId target
#define EVENGINE_API_DOMAINS
Definition Export.h:110
Move-only, checked operation results for the common layer.
Heightmap stamp
double spacingZ
double spacingX
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
Native orchestration of Pcg RuntimeStamper's load, flatten, fit, mask, and stamp sequence.
const std::string & progressText() const noexcept
Return the current user-facing progress text.
PcgRuntimeStampStatus status() const noexcept
Return the lifecycle state.
const std::string & stampAddress() const noexcept
Return the normalized resource address.
double labelCenterX() const noexcept
Return progress-label center X.
double updateTimeAllowed() const noexcept
Return Pcg's incremental update allowance, 1/15 second.
double labelCenterY() const noexcept
Return progress-label center Y.
PcgRuntimeStampStatus
Observable lifecycle of Pcg's runtime stamper sample.