createInstruction method

  1. @override
List<Instruction> createInstruction(
  1. TurtleState turtle,
  2. Map argv
)
override

Creates instructions.

Implementation

@override
List<Instruction> createInstruction(TurtleState turtle, Map argv) {
  final copy = Map.of(argv);
  return condition(copy)
      ? List<Instruction>.of(commands
          .map((command) => command.createInstruction(turtle, copy))
          .expand((x) => x))
      : [];
}