]> Dogcows Code - chaz/yoink/blob - src/GameLayer.hh
constructors should be explicit
[chaz/yoink] / src / GameLayer.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #ifndef _GAMELAYER_HH_
13 #define _GAMELAYER_HH_
14
15 /**
16 * @file GameLayer.hh
17 * This is the big enchilada.
18 */
19
20 #include <iostream>
21 #include <string>
22 #include <vector>
23
24 #include <boost/shared_ptr.hpp>
25
26 #include <Moof/Math.hh>
27 #include <Moof/Sound.hh>
28
29 #include <Moof/Line.hh> // TODO
30 #include <Moof/Plane.hh>
31 #include <Moof/Ray.hh>
32 #include <Moof/Sphere.hh>
33 #include <Moof/Timer.hh>
34 #include <Moof/View.hh>
35
36 #include "GameState.hh"
37 #include "Hud.hh"
38
39
40 class GameLayer;
41 typedef boost::shared_ptr<GameLayer> GameLayerP;
42
43 class GameLayer : public Mf::View
44 {
45 public:
46
47 static GameLayerP alloc()
48 {
49 return GameLayerP(new GameLayer);
50 }
51 GameLayer();
52
53 void didAddToView();
54
55 void update(Mf::Scalar t, Mf::Scalar dt);
56 void draw(Mf::Scalar alpha) const;
57 bool handleEvent(const Mf::Event& event);
58
59 private:
60
61 void loadSceneLoader();
62 void advanceScene(Mf::Settings& settings);
63
64 void thinkTimer();
65
66 void setProjection();
67 void setProjection(Mf::Scalar width, Mf::Scalar height);
68
69 GameState mState;
70 Mf::Timer mThinkTimer;
71
72 HudP mHud;
73
74 Mf::SoundStream mMusic;
75 Mf::Sound mPunchSound;
76
77 Mf::Ray2 mRay;
78 Mf::Line2 mLine;
79 Mf::Circle mCircle;
80
81 Mf::Timer mRayTimer;
82 void rayTimer();
83 };
84
85
86 #endif // _GAMELAYER_HH_
87
This page took 0.035153 seconds and 4 git commands to generate.