nodes: Added primitive saving and loading mechanism

Not fully integrated yet. Also doesn't yet save any node settings, just nodes and links
This commit is contained in:
WerWolv
2021-05-17 23:17:58 +02:00
parent cf67adfa42
commit ee2b412a10
8 changed files with 148 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ namespace hex::dp {
In, Out
};
Attribute(IOType ioType, Type type, std::string_view unlocalizedName) : m_id(SharedData::dataProcessorNodeIdCounter++), m_ioType(ioType), m_type(type), m_unlocalizedName(unlocalizedName) {
Attribute(IOType ioType, Type type, std::string_view unlocalizedName) : m_id(SharedData::dataProcessorAttrIdCounter++), m_ioType(ioType), m_type(type), m_unlocalizedName(unlocalizedName) {
}
@@ -26,6 +26,8 @@ namespace hex::dp {
}
[[nodiscard]] u32 getID() const { return this->m_id; }
void setID(u32 id) { this->m_id = id; }
[[nodiscard]] IOType getIOType() const { return this->m_ioType; }
[[nodiscard]] Type getType() const { return this->m_type; }
[[nodiscard]] std::string_view getUnlocalizedName() const { return this->m_unlocalizedName; }