载入中...
搜索中...
未找到
PcgSpawnProgress.h
浏览该文件的文档.
1#pragma once
2#include "common/Result.h"
3#include <string>
4namespace eve::procgen {
9public:
11 [[nodiscard]] Result<PcgSpawnProgressStatus> updateRule(std::string spawnerName, int totalRuleCount,
12 int totalRulesCompleted, int spawnerRuleCount,
13 int spawnerRulesCompleted);
15 [[nodiscard]] Result<PcgSpawnProgressStatus> updateRuleFraction(double progress);
17 [[nodiscard]] Result<PcgSpawnProgressStatus> requestCancel();
19 [[nodiscard]] PcgSpawnProgressStatus clear() noexcept;
21 [[nodiscard]] double progress() const noexcept;
23 [[nodiscard]] const std::string& title() const noexcept { return title_; }
25 [[nodiscard]] const std::string& subtitle() const noexcept { return subtitle_; }
27 [[nodiscard]] PcgSpawnProgressStatus status() const noexcept { return status_; }
28private:
29 std::string title_;
30 std::string subtitle_;
31 int totalRuleCount_ = 0;
32 int totalRulesCompleted_ = 0;
33 int spawnerRuleCount_ = 0;
34 int spawnerRulesCompleted_ = 0;
35 double ruleProgress_ = 0;
36 PcgSpawnProgressStatus status_ = PcgSpawnProgressStatus::Hidden;
37};
38} // namespace eve::procgen
#define EVENGINE_API_DOMAINS
Definition Export.h:110
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Caller-owned, deterministic progress state corresponding to Pcg SpawnProgressBar. @thread Spawning th...
const std::string & title() const noexcept
Return the fixed title.
PcgSpawnProgressStatus status() const noexcept
Return the lifecycle state.
const std::string & subtitle() const noexcept
Return the formatted rule subtitle.
PcgSpawnProgressStatus
Observable lifecycle of a Pcg spawning progress operation.