Fix bad Hollywoo naming conventions
This commit is contained in:
@@ -10,7 +10,6 @@ import haxe.io.Path;
|
||||
import kiss.Kiss;
|
||||
import kiss.cloner.Cloner;
|
||||
|
||||
|
||||
typedef Continuation = () -> Void;
|
||||
typedef AsyncCommand = (AsyncEmbeddedScript, Continuation) -> Void;
|
||||
|
||||
|
@@ -5,4 +5,4 @@ import kiss.List;
|
||||
import flixel.FlxSprite;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class FlxActorSprite extends FlxSprite {}
|
||||
class ActorFlxSprite extends FlxSprite {}
|
@@ -2,10 +2,11 @@ package hollywoo_flixel;
|
||||
|
||||
import kiss.Prelude;
|
||||
import kiss.List;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import hollywoo.Scene;
|
||||
import hollywoo.Director;
|
||||
import hollywoo.Stage;
|
||||
|
||||
import hollywoo_flixel.FlxStageState;
|
||||
import hollywoo_flixel.FlxMovie;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class FlxDirector implements Director<FlxSetState, FlxStagePosition, FlxStageFacing, FlxScreenPosition, FlxActorSprite> {}
|
||||
class FlxDirector implements Director<String, FlxStagePosition, FlxStageFacing, FlxScreenPosition, ActorFlxSprite> {}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
(defNew [])
|
||||
|
||||
(method :Void showSet [:FlxSetState set :Appearance appearance :Continuation cc]
|
||||
(print "Shneezy"))
|
||||
(method :Void showScene [:Scene<String,FlxStagePosition,FlxStageFacing,FlxScreenPosition,ActorFlxSprite> scene :Appearance appearance :Continuation cc]
|
||||
(FlxG.switchState (cast scene SceneFlxState)))
|
||||
|
||||
(method :Void showCharacter [:Character<FlxStagePosition,FlxStageFacing,FlxActorSprite> character :Appearance appearance :Continuation cc]
|
||||
(method :Void showCharacter [:Character<FlxStagePosition,FlxStageFacing,ActorFlxSprite> character :Appearance appearance :Continuation cc]
|
||||
(print "Character shneezy"))
|
||||
|
@@ -1,7 +1,10 @@
|
||||
package hollywoo_flixel;
|
||||
|
||||
import flixel.FlxState;
|
||||
import hollywoo.Stage;
|
||||
import flixel.FlxSprite;
|
||||
import hollywoo.Movie;
|
||||
import hollywoo_flixel.ActorFlxSprite;
|
||||
import hollywoo_flixel.SceneFlxState;
|
||||
|
||||
enum FlxStagePosition {
|
||||
Left;
|
||||
@@ -22,7 +25,4 @@ enum FlxScreenPosition {
|
||||
UpperCenter;
|
||||
}
|
||||
|
||||
typedef FlxStage = Stage<FlxSetState, FlxStagePosition, FlxStageFacing, FlxScreenPosition, FlxActorSprite>;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class FlxStageState extends FlxState {}
|
||||
class FlxMovie extends Movie<String, FlxStagePosition, FlxStageFacing, FlxScreenPosition, ActorFlxSprite> {}
|
@@ -1,5 +0,0 @@
|
||||
(method &override :Void create []
|
||||
(super.create))
|
||||
|
||||
(method &override :Void update [:Float elapsed]
|
||||
(super.update elapsed))
|
@@ -1,8 +1,6 @@
|
||||
package hollywoo_flixel;
|
||||
|
||||
import kiss.Prelude;
|
||||
import kiss.List;
|
||||
import flixel.FlxState;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class FlxSetState extends FlxState {}
|
||||
class MovieFlxState extends FlxState {}
|
@@ -1,11 +1,10 @@
|
||||
(prop &mut :FlxDirector director)
|
||||
(prop &mut :FlxStage stage)
|
||||
(prop &mut :FlxMovie movie)
|
||||
|
||||
(method &override :Void create []
|
||||
(super.create)
|
||||
(set director (new FlxDirector))
|
||||
//(this.run)
|
||||
)
|
||||
(set movie (new FlxMovie director)))
|
||||
|
||||
(method &override :Void update [:Float elapsed]
|
||||
(super.update elapsed))
|
@@ -0,0 +1,11 @@
|
||||
package hollywoo_flixel;
|
||||
|
||||
import kiss.Prelude;
|
||||
import kiss.List;
|
||||
import flixel.FlxState;
|
||||
import flixel.FlxSprite;
|
||||
import hollywoo.Scene;
|
||||
import hollywoo_flixel.FlxMovie;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class SceneFlxState extends FlxState {}
|
@@ -0,0 +1,12 @@
|
||||
(defNew [&prop :String set &prop :SceneTime time &prop :ScenePerspective perspective]
|
||||
[
|
||||
:Map<String,Character<FlxStagePosition,FlxStageFacing,ActorFlxSprite>> characters (new Map)
|
||||
]
|
||||
(super))
|
||||
|
||||
(method &override :Void create []
|
||||
(super.create)
|
||||
(add (.loadGraphic (new FlxSprite 0 0) set)))
|
||||
|
||||
(method &override :Void update [:Float elapsed]
|
||||
(super.update elapsed))
|
@@ -1,6 +1,6 @@
|
||||
package hollywoo;
|
||||
|
||||
import hollywoo.Stage;
|
||||
import hollywoo.Scene;
|
||||
|
||||
enum Appearance {
|
||||
FirstAppearance;
|
||||
@@ -10,6 +10,6 @@ enum Appearance {
|
||||
typedef Continuation = Void -> Void;
|
||||
|
||||
interface Director<Set, StagePosition, StageFacing, ScreenPosition, Actor> {
|
||||
function showSet(set:Set, appearance:Appearance, cc:Continuation):Void;
|
||||
function showScene(scene:Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor>, appearance:Appearance, cc:Continuation):Void;
|
||||
function showCharacter(character:Character<StagePosition, StageFacing, Actor>, appearance:Appearance, cc:Continuation):Void;
|
||||
}
|
||||
|
13
projects/hollywoo/src/hollywoo/Movie.hx
Normal file
13
projects/hollywoo/src/hollywoo/Movie.hx
Normal file
@@ -0,0 +1,13 @@
|
||||
package hollywoo;
|
||||
|
||||
import kiss.AsyncEmbeddedScript;
|
||||
|
||||
/**
|
||||
* Model of a Hollywoo film
|
||||
*/
|
||||
@:build(kiss.Kiss.build())
|
||||
class Movie<Set, StagePosition, StageFacing, ScreenPosition, Actor> 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>> = [];
|
||||
}
|
6
projects/hollywoo/src/hollywoo/Movie.kiss
Normal file
6
projects/hollywoo/src/hollywoo/Movie.kiss
Normal file
@@ -0,0 +1,6 @@
|
||||
// Mostly immutable, reusable resources:
|
||||
(prop :Map<String,Set> sets (new Map))
|
||||
(prop :Map<String,Actor> actors (new Map))
|
||||
|
||||
// "View" in the Model-View-Controller architecture:
|
||||
(defNew [&prop :Director<Set,StagePosition,StageFacing,ScreenPosition,Actor> director] (super))
|
@@ -1,7 +1,5 @@
|
||||
package hollywoo;
|
||||
|
||||
import kiss.EmbeddedScript;
|
||||
|
||||
enum SceneTime {
|
||||
Morning;
|
||||
Day;
|
||||
@@ -27,17 +25,3 @@ typedef Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor> = {
|
||||
time:SceneTime,
|
||||
perspective:ScenePerspective
|
||||
};
|
||||
|
||||
/**
|
||||
* Model of a Hollywoo film
|
||||
*/
|
||||
@:build(kiss.Kiss.build())
|
||||
class Stage<Set, StagePosition, StageFacing, ScreenPosition, Actor> extends kiss.AsyncEmbeddedScript {
|
||||
// Mostly immutable, reusable resources:
|
||||
var sets:Map<String, Set> = [];
|
||||
var actors:Map<String, Actor> = [];
|
||||
|
||||
|
||||
// Mutable representation of frames in time:
|
||||
var scenes:Map<String, Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor>> = [];
|
||||
}
|
@@ -1,2 +0,0 @@
|
||||
// "View" in the Model-View-Controller architecture:
|
||||
(defNew [&prop :Director<Set,StagePosition,StageFacing,ScreenPosition,Actor> director] (super))
|
Reference in New Issue
Block a user