Skip to content

Commit

Permalink
Updated GUIParser to remove value-class declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
fulminazzo committed Apr 11, 2024
1 parent ab1e978 commit 622a9ed
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import it.fulminazzo.fulmicollection.interfaces.functions.BiFunctionException;
import it.fulminazzo.fulmicollection.interfaces.functions.TriConsumer;
import it.fulminazzo.fulmicollection.objects.Refl;
import it.fulminazzo.fulmicollection.utils.ReflectionUtils;
import it.fulminazzo.yamlparser.configuration.IConfiguration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand All @@ -23,9 +24,11 @@ public GUIParser() {
Integer size = c.getInteger(s + ".size");
if (size == null) throw new IllegalArgumentException("'size' cannot be null");
Refl<GUI> gui = new Refl<>(g);
Class<?> contentsClass = ReflectionUtils.getClass(GUI.class.getCanonicalName() + "Impl.Contents");
@Nullable List<?> contents = c.getList(s + ".contents", contentsClass);
gui.setFieldObject("contents", gui.invokeMethod("createContents",
new Class[]{int.class, List.class},
size, gui.getFieldObject("contents")));
size, contents));
return g;
};
}
Expand All @@ -35,6 +38,7 @@ public GUIParser() {
return (c, s, g) -> {
super.getDumper().accept(c, s, g);
if (g == null) return;
c.set(s + ".contents.value-class", null);
c.set(s + ".size", g.getSize());
};
}
Expand Down

0 comments on commit 622a9ed

Please sign in to comment.