Skip to content

Commit bcc16ba

Browse files
committed
Load child helper in LXSerializable.Utils
1 parent 233f824 commit bcc16ba

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/heronarts/lx/LXSerializable.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ public static void saveParameter(LXParameter parameter, JsonObject obj, String p
133133
}
134134
}
135135

136+
public static void loadChild(LXComponent child, JsonObject obj, String path) {
137+
if (obj.has(LXComponent.KEY_CHILDREN)) {
138+
final JsonObject children = obj.getAsJsonObject(LXComponent.KEY_CHILDREN);
139+
if (children.has(path)) {
140+
child.load(child.getLX(), children.getAsJsonObject(path));
141+
}
142+
}
143+
}
144+
136145
/**
137146
* Utility function to load a set of parameters
138147
*

0 commit comments

Comments
 (0)