载入中...
搜索中...
未找到
StoryEvent.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
7#include "common/Result.h"
8
9#include <string>
10#include <vector>
11
12namespace eve::rpg {
13
14class GameState;
15
18
22 std::string reference;
23 std::string actorId;
24 double x = 0.0;
25 double y = 0.0;
26 double duration = 0.0;
27};
28
31 std::string id;
32 bool repeatable = false;
33 std::vector<StoryEventStep> steps;
34};
35
38public:
47 [[nodiscard]] static eve::Result<int> replaceFromJsonStrict(const std::string& json);
49 static void clear();
51 static int count();
53 static bool contains(const std::string& eventId);
60 static const StoryEventDefinition* find(const std::string& eventId);
61};
62
69public:
80 [[nodiscard]] eve::Result<void> begin(const std::string& eventId, GameState* gameState);
81
90 [[nodiscard]] eve::Result<int> advance(GameState* gameState);
91
93 bool isActive() const;
95 bool isFinished() const;
97 int getStepIndex() const;
99 int getStepCount() const;
101 std::string getEventId() const;
103 std::string getStepKind() const;
105 std::string getReference() const;
107 std::string getActorId() const;
109 double getX() const;
111 double getY() const;
113 double getDuration() const;
114
115private:
120 const StoryEventStep* current() const noexcept;
121 StoryEventDefinition definition_;
122 int cursor_ = 0;
123 bool active_ = false;
124 bool finished_ = false;
125};
126
127} // namespace eve::rpg
#define EVENGINE_API_PLATFORM
Definition Export.h:107
float begin
Move-only, checked operation results for the common layer.
double current
std::uint32_t count
Move-only operation result carrying either a value or Status.
Definition Result.h:155
一份游戏状态(开关/变量/独立变量)。
Definition GameState.h:25
Strict process-local catalogue for versioned story-event content.
Definition StoryEvent.h:37
Caller-owned runtime cursor over a copied story-event definition.
Definition StoryEvent.h:68
RPG 模块的基础实体:把属性 / 状态 / 技能三张表挂到一个 ECS 实体上。
StoryEventStepKind
Closed set of UI-neutral presentation commands emitted by a story event.
Definition StoryEvent.h:17
One immutable, ordered and resumable story-event definition.
Definition StoryEvent.h:30
std::vector< StoryEventStep > steps
Definition StoryEvent.h:33
One immutable presentation command owned by a story-event definition.
Definition StoryEvent.h:20
StoryEventStepKind kind
Definition StoryEvent.h:21