Skip to content

Commit

Permalink
Add name to node graph schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuscu committed Sep 29, 2024
1 parent a1027fc commit e9f37ec
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/nodegraph/include/nodegraph/NodeGraphSchema.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ namespace l::nodegraph {

using CustomCreateFunctionType = NodeGraphBase*(int32_t, NodeGraphGroup&);

NodeGraphSchema() {
NodeGraphSchema(std::string name = "") :
mName(name.empty() ? "Schema" : name)
{
RegisterNodeType("Source", 0, "Value [0,1]");
RegisterNodeType("Source", 1, "Value [-1,1]");
RegisterNodeType("Source", 2, "Value [0,100]");
Expand Down Expand Up @@ -99,6 +101,13 @@ namespace l::nodegraph {

~NodeGraphSchema() = default;

void SetName(std::string_view name) {
mName = name;
}
std::string_view GetName() {
return mName;
}

void SetCustomCreator(std::function<CustomCreateFunctionType> customCreator);
void SetKeyState(l::hid::KeyState* keyState);
void SetAudioOutput(l::audio::AudioStream* audioStream);
Expand All @@ -114,6 +123,7 @@ namespace l::nodegraph {
void Tick(int32_t tickCount, float elapsed);
protected:
NodeGraphGroup mMainNodeGraph;
std::string mName;

std::function<CustomCreateFunctionType> mCreateCustomNode;
l::hid::KeyState* mKeyState = nullptr;
Expand Down

0 comments on commit e9f37ec

Please sign in to comment.