载入中...
搜索中...
未找到
Tags.cpp
浏览该文件的文档.
14 eve::cap::addListener<eve::IStateMutation>(static_cast<eve::IStateMutation*>(worldAdapter_.get()));
20 eve::cap::removeListener<eve::IStateMutation>(static_cast<eve::IStateMutation*>(worldAdapter_.get()));
28 return index < 0 || static_cast<std::size_t>(index) >= values.size() ? std::string{} : values[index];
60bool Tags::add(const std::string& subject, const std::string& tag) { return store_.addTag(subject, tag); }
61bool Tags::remove(const std::string& subject, const std::string& tag) { return store_.removeTag(subject, tag); }
62bool Tags::has(const std::string& subject, const std::string& tag) const { return store_.hasTag(subject, tag); }
63int Tags::count(const std::string& subject) const { return static_cast<int>(store_.tagsOf(subject).size()); }
64std::string Tags::at(const std::string& subject, int index) const { return valueAt(store_.tagsOf(subject), index); }
65int Tags::subjectCount(const std::string& tag) const { return static_cast<int>(store_.subjectsWithTag(tag).size()); }
Consumer-owned query and mutation contracts for authoritative world state.
All-or-nothing mutation boundary owned by the consumer.
Definition StateAccess.h:107
Read-only world-state boundary owned by consumers such as Dialogue.
Definition StateAccess.h:79
bool removeSubject(const SubjectId &subject)
Removes all tags and capabilities belonging to one subject.
Definition TagStore.cpp:124
std::vector< std::string > tagsOf(const SubjectId &subject) const
Returns a subject's tags in lexical order.
Definition TagStore.cpp:66
bool removeTag(const SubjectId &subject, const std::string &tag)
Removes a tag from a subject.
Definition TagStore.cpp:53
bool removeCapability(const SubjectId &subject, const std::string &capability)
Removes a capability from a subject.
Definition TagStore.cpp:104
bool addCapability(const SubjectId &subject, const std::string &capability)
Adds a capability to a subject.
Definition TagStore.cpp:101
std::vector< std::string > capabilitiesOf(const SubjectId &subject) const
Returns a subject's capabilities in lexical order.
Definition TagStore.cpp:111
bool hasTag(const SubjectId &subject, const std::string &tag) const
Tests whether a subject has an exact tag.
Definition TagStore.cpp:56
const std::vector< TagChangeEvent > & events() const
Returns queued changes in deterministic sequence order.
Definition TagStore.h:72
bool addTag(const SubjectId &subject, const std::string &tag)
Adds a tag to a subject.
Definition TagStore.cpp:50
std::vector< SubjectId > subjectsWithTag(const std::string &tag) const
Returns subjects carrying a tag in lexical order.
Definition TagStore.cpp:70
bool hasCapability(const SubjectId &subject, const std::string &capability) const
Tests whether a subject has an exact capability.
Definition TagStore.cpp:107
bool removeCapability(const std::string &subject, const std::string &capability)
Removes a capability from a subject.
Definition Tags.cpp:73
int subjectCount(const std::string &tag) const
Gets the number of subjects carrying a tag.
Definition Tags.cpp:65
bool remove(const std::string &subject, const std::string &tag)
Removes a tag from a subject.
Definition Tags.cpp:61
int capabilityCount(const std::string &subject) const
Gets a subject's capability count.
Definition Tags.cpp:79
std::string at(const std::string &subject, int index) const
Gets a subject's tag by deterministic index, or an empty string.
Definition Tags.cpp:64
std::string subjectAt(const std::string &tag, int index) const
Gets a subject carrying a tag by deterministic index, or an empty string.
Definition Tags.cpp:66
bool hasCapability(const std::string &subject, const std::string &capability) const
Tests whether a subject has a capability.
Definition Tags.cpp:76
bool removeSubject(const std::string &subject)
Removes every tag and capability belonging to a subject.
Definition Tags.cpp:86
std::string eventAction(int index) const
Gets event action by index, or an empty string.
Definition Tags.cpp:93
bool add(const std::string &subject, const std::string &tag)
Adds a tag to a subject.
Definition Tags.cpp:60
bool addCapability(const std::string &subject, const std::string &capability)
Adds a capability to a subject.
Definition Tags.cpp:70
std::string eventValue(int index) const
Gets event tag or capability by index, or an empty string.
Definition Tags.cpp:101
bool has(const std::string &subject, const std::string &tag) const
Tests whether a subject has a tag.
Definition Tags.cpp:62
std::string eventSubject(int index) const
Gets event subject by index, or an empty string.
Definition Tags.cpp:97
std::string capabilityAt(const std::string &subject, int index) const
Gets a capability by deterministic index, or an empty string.
Definition Tags.cpp:82
Definition GameplayTag.cpp:9
TagStore implementation of the common world-state contracts.