diff --git a/hank/Story.hx b/hank/Story.hx index c09606d..222867c 100644 --- a/hank/Story.hx +++ b/hank/Story.hx @@ -18,13 +18,14 @@ using Choice.ChoiceExtension; import hank.HankAST.ExprType; import hank.StoryTree; import hank.Alt.AltInstance; +import hank.Types; /** Possible states of the story being executed. **/ enum StoryFrame { HasText(text:String); - HasChoices(choices:Array, tags:Array>); + HasChoices(choices:Array, tags:TagArray); Finished; } @@ -344,7 +345,7 @@ class Story { for (choiceInfo in choices) choiceInfo.output.format(this, hInterface, random, altInstances, nodeScopes, false) ]; - var tags = [ + var tags:TagArray = [ for (choiceInfo in choices) choiceInfo.tags ]; @@ -639,7 +640,7 @@ class Story { return removeDoubleSpaces(t).trim(); } - private function finalChoiceProcessing(choices:Array, tags:Array>) { + private function finalChoiceProcessing(choices:Array, tags:TagArray) { return HasChoices([for (c in choices) removeDoubleSpaces(c).trim()], tags); } @@ -675,7 +676,7 @@ class Story { public function run( showText:(String,Void->Void)->Void, - showChoices:(Array,Array>,Int->Void)->Void, + showChoices:(Array,TagArray,Int->Void)->Void, finish:Void->Void) { var loop = run.bind(showText, showChoices, finish); diff --git a/hank/Types.hx b/hank/Types.hx new file mode 100644 index 0000000..6f14d35 --- /dev/null +++ b/hank/Types.hx @@ -0,0 +1,7 @@ +package hank; + +#if gdscript +typedef TagArray = Array; +#else +typedef TagArray = Array>; +#end \ No newline at end of file