1 // $Id$
2 
3 // Fish Supper
4 // Copyright 2006, 2007, 2009, 2010 Matthew Clarke <mafferyew@googlemail.com>
5 //
6 // This file is part of Fish Supper.
7 //
8 // Fish Supper is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // Fish Supper is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with Fish Supper.  If not, see <http://www.gnu.org/licenses/>.
20 
21 
22 
23 
24 #ifndef Game_manager_h
25 #define Game_manager_h
26 
27 
28 
29 
30 #include "SDL.h"
31 #include "Game_timer.h"
32 #include "Title_screen.h"
33 #include "Play.h"
34 #include "Get_ready_screen.h"
35 #include "enums.h"
36 #include "Sound_engine.h"
37 #include "High_scores_display.h"
38 #include "Settings.h"
39 #include "Settings_screen.h"
40 #include "User_input.h"
41 #include <iostream>
42 #include <memory>
43 
44 
45 
46 
47 extern std::shared_ptr<FS::User_input> input_ptr;
48 extern FS::Mode current_mode;
49 
50 
51 
52 
53 namespace FS
54 {
55 
56 class Game_manager
57 {
58     public:
59         enum State { INTRO, SELECTING_START_LEVEL, GET_READY, PLAY,
60                 SETTINGS, HI_SCORES, ENTERING_NAME };
61 
62         static const int MAX_EVENTS = 10;
63 
64         Game_manager();
65         ~Game_manager();
66 
67         void start_loop();
68 
69     private:
70         GameTimer timer;
71         Title_screen my_title_screen;
72         Play p_model;
73         Get_ready_screen my_gr_screen;
74         Sound_engine snd_engine;
75         High_scores_display my_hs_screen;
76         Settings my_settings;
77         Settings_screen my_settings_screen;
78 
79         State current_state;
80         bool loop_running;
81 
82         void handle_selection(Title_screen::Selection sel);
83 
84 }; // class Game_manager
85 
86 } // namespace FS
87 
88 
89 
90 
91 #endif
92 
93