Store Hollywoo objects in improved FuzzyMap

This commit is contained in:
2021-12-15 15:05:28 -07:00
parent 8cbfca281b
commit a13b692aca
2 changed files with 10 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import haxe.Constraints.Function;
import haxe.Timer;
import kiss.AsyncEmbeddedScript;
import kiss.Prelude;
import kiss.FuzzyMap;
import hollywoo.Scene;
import hollywoo.Director;
@@ -20,5 +21,5 @@ enum DelayHandling {
class Movie<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound, Song, Prop> extends AsyncEmbeddedScript {
// TODO for some reason this wasn't working when declared in Movie.kiss:
// Mutable representation of frames in time:
var scenes:Map<String, Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor, Prop>> = [];
var scenes:FuzzyMap<Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor, Prop>> = new FuzzyMap<Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor, Prop>>();
}

View File

@@ -2,19 +2,20 @@
(#unless subclass
// Mostly immutable, reusable resources:
(prop :Map<String,Set> sets (new Map))
(prop :Map<String,Actor> actors (new Map))
(prop :Map<String,Sound> sounds (new Map))
(prop :Map<String,Song> songs (new Map))
(prop :Map<String,Prop> props (new Map))
(prop :FuzzyMap<Set> sets (new FuzzyMap<Set>))
(prop :FuzzyMap<Actor> actors (new FuzzyMap<Actor>))
(prop :FuzzyMap<Sound> sounds (new FuzzyMap<Sound>))
(prop :FuzzyMap<Song> songs (new FuzzyMap<Song>))
(prop :FuzzyMap<Prop> props (new FuzzyMap<Prop>))
(prop &mut :DelayHandling delayHandling AutoWithSkip)
// TODO for some reason this won't work when declared in Kiss syntax:
// Mutable representation of frames in time:
// var scenes:Map<String, Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor>> = [];
(prop :Map<String,Bool> shownScenes (new Map))
(prop :Map<String,Bool> shownCharacters (new Map))
(prop :FuzzyMap<Bool> shownScenes (new FuzzyMap<Bool>))
(prop :FuzzyMap<Bool> shownCharacters (new FuzzyMap<Bool>))
// This is set and unset by doPreload defined in HollywooDSL.kiss
(prop &mut isLoading false)