Skip to content

Commit e8090f9

Browse files
committed
Bugfix NodeClassMethod not saving IsStatic
1 parent 58bf23d commit e8090f9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/NodeDev.Core/Class/NodeClassMethod.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ namespace NodeDev.Core.Class
1212
{
1313
public class NodeClassMethod : IMethodInfo
1414
{
15-
public record class SerializedNodeClassMethod(string Name, string ReturnType, List<string> Parameters, string Graph);
16-
public NodeClassMethod(NodeClass ownerClass, string name, TypeBase returnType, Graph graph)
15+
public record class SerializedNodeClassMethod(string Name, string ReturnType, List<string> Parameters, string Graph, bool IsStatic);
16+
public NodeClassMethod(NodeClass ownerClass, string name, TypeBase returnType, Graph graph, bool isStatic = false)
1717
{
1818
Class = ownerClass;
1919
Name = name;
2020
ReturnType = returnType;
2121
Graph = graph;
22+
IsStatic = isStatic;
2223

2324
Graph.SelfMethod = this;
2425
}
@@ -96,7 +97,7 @@ public static NodeClassMethod Deserialize(NodeClass owner, string serialized)
9697

9798
var returnType = TypeBase.Deserialize(owner.Project.TypeFactory, serializedNodeClassMethod.ReturnType);
9899
var graph = new Graph();
99-
var nodeClassMethod = new NodeClassMethod(owner, serializedNodeClassMethod.Name, returnType, graph);
100+
var nodeClassMethod = new NodeClassMethod(owner, serializedNodeClassMethod.Name, returnType, graph, serializedNodeClassMethod.IsStatic);
100101
graph.SelfMethod = nodeClassMethod; // a bit / really ugly
101102

102103
foreach (var parameter in serializedNodeClassMethod.Parameters)
@@ -119,7 +120,7 @@ public void Deserialize_Step3()
119120

120121
public string Serialize()
121122
{
122-
var serializedNodeClassMethod = new SerializedNodeClassMethod(Name, ReturnType.SerializeWithFullTypeName(), Parameters.Select(x => x.Serialize()).ToList(), Graph.Serialize());
123+
var serializedNodeClassMethod = new SerializedNodeClassMethod(Name, ReturnType.SerializeWithFullTypeName(), Parameters.Select(x => x.Serialize()).ToList(), Graph.Serialize(), IsStatic);
123124
return System.Text.Json.JsonSerializer.Serialize(serializedNodeClassMethod);
124125
}
125126

0 commit comments

Comments
 (0)