From 48659c28bf6a6fbcff2c8e67247680afaa023de9 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sat, 25 Dec 2021 14:22:32 +0100 Subject: Turns Wyrd's computation into the instruction. --- .../tonkadur/jsonexport/InstructionCompiler.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/json-export') diff --git a/src/json-export/src/tonkadur/jsonexport/InstructionCompiler.java b/src/json-export/src/tonkadur/jsonexport/InstructionCompiler.java index c23b5b1..79cb4ea 100644 --- a/src/json-export/src/tonkadur/jsonexport/InstructionCompiler.java +++ b/src/json-export/src/tonkadur/jsonexport/InstructionCompiler.java @@ -156,6 +156,27 @@ public class InstructionCompiler implements InstructionVisitor result.put("value", cc.get_result()); } + public void visit_set_random (final SetRandom n) + throws Throwable + { + final ComputationCompiler target_cc, min_cc, max_cc; + + target_cc = new ComputationCompiler(); + min_cc = new ComputationCompiler(); + max_cc = new ComputationCompiler(); + + n.get_target().get_visited_by(target_cc); + n.get_min().get_visited_by(min_cc); + n.get_max().get_visited_by(max_cc); + + result = new JSONObject(); + + result.put("category", "set_random"); + result.put("target", target_cc.get_result()); + result.put("min", min_cc.get_result()); + result.put("max", max_cc.get_result()); + } + public void visit_set_value (final SetValue n) throws Throwable { @@ -214,6 +235,7 @@ public class InstructionCompiler implements InstructionVisitor result.put("label", label_cc.get_result()); } + public void visit_prompt_integer (final PromptInteger n) throws Throwable { -- cgit v1.2.3-70-g09d2