载入中...
搜索中...
未找到
Tags.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/Module.h"
5#include "tags/GameplayTag.h"
6#include "tags/TagStore.h"
7
8#include <memory>
9#include <string>
10
11namespace eve::tags {
12
13class TagStoreStateAdapter;
14
17public:
20 Tags();
22 ~Tags() override;
23
25 bool add(const std::string& subject, const std::string& tag);
27 bool remove(const std::string& subject, const std::string& tag);
29 bool has(const std::string& subject, const std::string& tag) const;
31 int count(const std::string& subject) const;
33 std::string at(const std::string& subject, int index) const;
35 int subjectCount(const std::string& tag) const;
37 std::string subjectAt(const std::string& tag, int index) const;
38
40 bool addCapability(const std::string& subject, const std::string& capability);
42 bool removeCapability(const std::string& subject, const std::string& capability);
44 bool hasCapability(const std::string& subject, const std::string& capability) const;
46 int capabilityCount(const std::string& subject) const;
48 std::string capabilityAt(const std::string& subject, int index) const;
49
51 bool removeSubject(const std::string& subject);
53 void clear();
55 int eventCount() const;
57 int eventSequence(int index) const;
59 std::string eventAction(int index) const;
61 std::string eventSubject(int index) const;
63 std::string eventValue(int index) const;
65 void clearEvents();
67 TagStore& store() { return store_; }
75 GameplayTagRegistry& registry() { return registry_; }
83 const GameplayTagRegistry& registry() const { return registry_; }
84
85private:
86 TagStore store_;
87 GameplayTagRegistry registry_;
88 std::unique_ptr<TagStoreStateAdapter> worldAdapter_;
89};
90
91} // namespace eve::tags
int subject
Definition AnimSmr.cpp:163
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
Stable hierarchical gameplay-tag definitions and registry.
const std::string * tag
std::uint32_t count
uint32_t index
std::size_t at
EVENGINE_API_FOUNDATION public API.
Definition Module.h:46
Canonical owner of versioned gameplay-tag definitions.
Definition GameplayTag.h:49
Deterministic storage for generic tags and capabilities.
Definition TagStore.h:27
Script-facing module for generic tags and capabilities.
Definition Tags.h:16
TagStore & store()
Gives C++ callers direct access to the underlying store.
Definition Tags.h:67
const GameplayTagRegistry & registry() const
Gives C++ callers immutable owner-thread access to the canonical gameplay-tag registry.
Definition Tags.h:83
GameplayTagRegistry & registry()
Gives C++ callers owner-thread access to the canonical gameplay-tag registry.
Definition Tags.h:75