载入中...
搜索中...
未找到
SequenceAsset.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
7#include "common/Result.h"
8#include "common/Value.h"
9
10#include <cstdint>
11#include <string>
12#include <utility>
13#include <vector>
14
15namespace eve::dnut {
16
18enum class SequenceParameterType : std::uint8_t { Any, String, Integer, Number, Boolean };
19
28 std::string name;
30 bool required = true;
32 int sourceLine = 0;
33 int sourceColumn = 0;
34
36 SequenceParameter() = default;
38 explicit SequenceParameter(std::string parameterName) : name(std::move(parameterName)) {}
39};
40
56
67 std::string id;
68 std::string type;
69 std::string next;
71 std::vector<SequenceRoute> routes;
72 int sourceLine = 0;
73 int sourceColumn = 0;
74};
75
78 std::string id;
79 int version = 1;
80 bool repeatable = false;
81 std::string entry;
82 std::vector<SequenceParameter> parameters;
83 std::vector<SequenceNode> nodes;
84 int sourceLine = 0;
85 int sourceColumn = 0;
86
95 [[nodiscard]] const SequenceNode* findNode(const std::string& nodeId) const noexcept;
96
104 [[nodiscard]] eve::Result<void> validate() const;
105};
106
113[[nodiscard]] bool isCoreSequenceNodeType(const std::string& type) noexcept;
114
116[[nodiscard]] const char* sequenceParameterTypeName(SequenceParameterType type) noexcept;
117
118} // namespace eve::dnut
std::string nodeId
#define EVENGINE_API_PLATFORM
Definition Export.h:107
Move-only, checked operation results for the common layer.
Owning, renderer-independent dynamic values.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
std::map< std::string, Value > Object
Definition Value.h:34
bool isCoreSequenceNodeType(const std::string &type) noexcept
Return whether type is a control-flow type interpreted by the runtime.
const char * sequenceParameterTypeName(SequenceParameterType type) noexcept
Return the stable lowercase spelling of a parameter type.
SequenceParameterType
Declared value kind for one sequence invocation parameter.
@ String
Quoted string with escapes already resolved.
@ Number
Unsigned numeric literal; sign handling belongs to the parser.
Immutable, parameterized and versioned compiled sequence.
std::vector< SequenceNode > nodes
std::vector< SequenceParameter > parameters
One immutable step of a compiled sequence.
std::vector< SequenceRoute > routes
One typed invocation parameter declared by authored content.
SequenceParameter(std::string parameterName)
Constructs a SequenceParameter.
SequenceParameter()=default
Constructs a SequenceParameter.
SequenceParameterType type
One outgoing edge of a sequence node.