use of org.terasology.engine.logic.behavior.core.BehaviorTreeBuilder in project Terasology by MovingBlocks.
the class CountCallsTest method init.
@BeforeEach
public void init() {
constructCalled.clear();
destructCalled.clear();
executeCalled.clear();
nextId2 = 1;
gsonBuilder = new GsonBuilder();
BehaviorTreeBuilder builder = new BehaviorTreeBuilder() {
@Override
public BehaviorNode createNode(BehaviorNode node) {
return new CountDelegate(node);
}
};
gsonBuilder.registerTypeAdapter(BehaviorNode.class, builder);
// gsonBuilder.registerTypeAdapter(Action.class, new InheritanceAdapter<Action>("delay", Delay.class));
}
use of org.terasology.engine.logic.behavior.core.BehaviorTreeBuilder in project Terasology by MovingBlocks.
the class BehaviorTreeFormat method save.
public void save(OutputStream stream, BehaviorTreeData data) throws IOException {
BehaviorTreeBuilder builder = CoreRegistry.get(BehaviorTreeBuilder.class);
OutputStreamWriter writer = new OutputStreamWriter(stream, Charsets.UTF_8);
writer.write(builder.toJson(data.getRoot()));
writer.close();
}
Aggregations