]> Dogcows Code - chaz/yoink/blobdiff - src/GameLayer.hh
dispatch class not a singleton, engine is static
[chaz/yoink] / src / GameLayer.hh
index d75d9dc467e07ca998c57374e4482ac816b48112..53613617b513aa7e95ef993fe376b21ec1bf335a 100644 (file)
 
 #include <boost/shared_ptr.hpp>
 
-#include <Moof/Camera.hh>
-#include <Moof/Interpolator.hh>
 #include <Moof/Layer.hh>
 #include <Moof/Math.hh>
-#include <Moof/Script.hh>
 #include <Moof/Sound.hh>
 
-#include "Character.hh"
-#include "Heroine.hh"
-#include "Scene.hh"
+#include <Moof/Line.hh>
+#include <Moof/Plane.hh>
+#include <Moof/Ray.hh>
+#include <Moof/Sphere.hh>
+#include <Moof/Timer.hh>
+
+#include "Hud.hh"
+#include "GameState.hh"
 
 
 class GameLayer;
@@ -58,6 +60,7 @@ typedef boost::shared_ptr<GameLayer> GameLayerP;
 class GameLayer : public Mf::Layer
 {
 public:
+
        GameLayer();
 
        static GameLayerP alloc()
@@ -65,40 +68,36 @@ public:
                return GameLayerP(new GameLayer);
        }
 
-       void pushed(Mf::Engine& engine);
-
-       void update(Mf::Engine& engine, Mf::Scalar t, Mf::Scalar dt);
-       void draw(Mf::Engine& engine, Mf::Scalar alpha) const;
-       bool handleEvent(Mf::Engine& engine, const Mf::Event& event);
-
-       struct State
-       {
-               // the script object must be mutable because some script functions must be
-               // called during draw
-               mutable Mf::Script                      script;
-               std::vector<std::string>        sceneList;
-
-               HeroineP                heroine;
-               SceneP                  scene;
+       void pushedOntoEngine();
 
-               Mf::PolynomialInterpolator<5> interp;
-
-               Mf::Camera              camera;
-       };
+       void update(Mf::Scalar t, Mf::Scalar dt);
+       void draw(Mf::Scalar alpha) const;
+       bool handleEvent(const Mf::Event& event);
 
 private:
 
        void loadSceneLoader();
        void advanceScene();
 
-       Mf::Scalar getZCoord(const Mf::Vector2& position) const;
+       void thinkTimer();
 
        void setProjection();
        void setProjection(Mf::Scalar width, Mf::Scalar height);
 
-       State           mState;
-       Mf::Sound       mMusic;
-       Mf::Sound       mPunchSound;
+       GameState               mState;
+       Mf::Timer               mThinkTimer;
+
+       HudP                    mHud;
+
+       Mf::SoundStream mMusic;
+       Mf::Sound               mPunchSound;
+
+       Mf::Ray<2>              mRay;
+       Mf::Line<2>             mLine;
+       Mf::Sphere<2>   mSphere;
+
+       Mf::Timer               mRayTimer;
+       void rayTimer();
 };
 
 
This page took 0.017769 seconds and 4 git commands to generate.