Skip to content

Commit 8ef2587

Browse files
authored
feat: Expose additional flame_jenny Command classes (#3641)
It is possible to take the name of a `Node` in a `YarnProject` and inspect the `DialogueEntry` objects that its iterator returns. However, even though `DialogueEntry` objects can be either a `DialogueLine`, a `DialogueChoice`, or a `Command`, there is no way to actually reference a `Command`! `UserDefinedCommand` exists as a concrete implementation of `Command`, but there are other `Command` types that someone might be interested in. For my purposes, the `JumpCommand` and `VisitCommand` both are `Command` types that allow for the user to leave to other nodes. It would be convenient to be able to recursively follow these commands to their new nodes and also perform the same introspection that I would like to do the original node. This PR just exposes these additional, pre-existing classes for external use.
1 parent ea29929 commit 8ef2587

4 files changed

Lines changed: 3 additions & 5 deletions

File tree

packages/flame_jenny/jenny/lib/jenny.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ export 'src/dialogue_view.dart' show DialogueView;
66
export 'src/errors.dart' show SyntaxError, NameError, TypeError, DialogueError;
77
export 'src/function_storage.dart' show FunctionStorage;
88
export 'src/localization.dart' show Localization, localizationInfo;
9+
export 'src/structure/commands/command.dart' show Command;
10+
export 'src/structure/commands/jump_command.dart' show JumpCommand;
911
export 'src/structure/commands/user_defined_command.dart'
1012
show UserDefinedCommand;
13+
export 'src/structure/commands/visit_command.dart' show VisitCommand;
1114
export 'src/structure/dialogue_choice.dart' show DialogueChoice;
1215
export 'src/structure/dialogue_line.dart' show DialogueLine;
1316
export 'src/structure/dialogue_option.dart' show DialogueOption;

packages/flame_jenny/jenny/lib/src/parse/parse.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ import 'package:jenny/src/parse/token.dart';
33
import 'package:jenny/src/parse/tokenize.dart';
44
import 'package:jenny/src/structure/block.dart';
55
import 'package:jenny/src/structure/commands/character_command.dart';
6-
import 'package:jenny/src/structure/commands/command.dart';
76
import 'package:jenny/src/structure/commands/declare_command.dart';
87
import 'package:jenny/src/structure/commands/if_command.dart';
9-
import 'package:jenny/src/structure/commands/jump_command.dart';
108
import 'package:jenny/src/structure/commands/local_command.dart';
119
import 'package:jenny/src/structure/commands/set_command.dart';
1210
import 'package:jenny/src/structure/commands/stop_command.dart';
13-
import 'package:jenny/src/structure/commands/visit_command.dart';
1411
import 'package:jenny/src/structure/commands/wait_command.dart';
1512
import 'package:jenny/src/structure/dialogue_entry.dart';
1613
import 'package:jenny/src/structure/expressions/expression.dart';

packages/flame_jenny/jenny/test/structure/commands/jump_command_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:jenny/jenny.dart';
2-
import 'package:jenny/src/structure/commands/jump_command.dart';
32
import 'package:test/test.dart';
43

54
import '../../test_scenario.dart';

packages/flame_jenny/jenny/test/structure/commands/visit_command_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:jenny/jenny.dart';
22
import 'package:jenny/src/parse/token.dart';
33
import 'package:jenny/src/parse/tokenize.dart';
4-
import 'package:jenny/src/structure/commands/visit_command.dart';
54
import 'package:test/test.dart';
65

76
import '../../test_scenario.dart';

0 commit comments

Comments
 (0)