sys: Get rid of SharedData struct and cleanup code structure (#411)

* sys: Initial refactoring of the SharedData class

* sys/pattern: More refactoring, make every provider have its own patterns

* sys: Finished up refactoring. No more SharedData!

* sys: Fixed compile on Unix

* tests: Fixed unit tests

* sys: Moved view and lang files

* pattern: Added assignment operator support to for loops

* tests: Fixed compile issue
This commit is contained in:
WerWolv
2022-02-01 18:09:40 +01:00
committed by GitHub
parent 61fc479c79
commit 1991afb87b
110 changed files with 1592 additions and 1259 deletions

View File

@@ -22,8 +22,8 @@ namespace hex::dp {
virtual ~Node() = default;
[[nodiscard]] u32 getID() const { return this->m_id; }
void setID(u32 id) { this->m_id = id; }
[[nodiscard]] u32 getId() const { return this->m_id; }
void setId(u32 id) { this->m_id = id; }
[[nodiscard]] const std::string &getUnlocalizedName() const { return this->m_unlocalizedName; }
void setUnlocalizedName(const std::string &unlocalizedName) { this->m_unlocalizedName = unlocalizedName; }
@@ -52,6 +52,11 @@ namespace hex::dp {
this->m_processedInputs.clear();
}
static void setIdCounter(u32 id) {
if (id > Node::s_idCounter)
Node::s_idCounter = id;
}
private:
u32 m_id;
std::string m_unlocalizedTitle, m_unlocalizedName;
@@ -59,6 +64,8 @@ namespace hex::dp {
std::set<u32> m_processedInputs;
prv::Overlay *m_overlay = nullptr;
static u32 s_idCounter;
Attribute *getConnectedInputAttribute(u32 index) {
if (index >= this->getAttributes().size())
throw std::runtime_error("Attribute index out of bounds!");