Animation plugin works beautifully.
[potpourri.git] / include / core / Engine.h
blob4214fed3df0f8c2994bef86d2150b140ad3921b0
1 // Copyright 2008 Brian Caine
3 // This file is part of Potpourri.
5 // Potpourri is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Potpourri is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTIBILITY of FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Potpourri. If not, see <http://www.gnu.org/licenses/>.
19 // NOTES:
21 // This is the Engine class
23 #ifndef __ENGINE_H
24 #define __ENGINE_H
26 #include <map>
27 #include <string>
29 #include "PluginLoader.h"
30 #include "SettingsDB.h"
31 #include "Game.h"
32 #include "MediaLoader.h"
34 #include "../plugins/ui/UI.h"
35 #include "../plugins/media/Media.h"
37 namespace fragrant
39 const std::string DBLOC = ".settings.db";
40 const std::string PLUGINFOLDER = "./plugins";
41 const std::string GAME = "GAME";
42 const std::string PRESENTATION = "hehehe";
43 const std::string UIPLUGIN = "iostreamUI";
45 enum EngineResults
47 ER_Good,
48 ER_Bad
51 enum EngineSubResults // lulz, esr
53 ESR_UI,
54 ESR_Game,
55 ESR_Quit
58 struct EngineSub
60 EngineSubResults type;
61 std::string game;
62 std::string presentation;
65 struct EngineParams
67 std::map<std::string, std::string> params;
70 class UI;
71 class Engine
73 public:
75 Engine();
76 ~Engine();
78 EngineResults run(EngineParams params);
80 private:
81 SettingsDB* d_settings;
82 PluginLoader* d_plugin_loader;
84 void initSettingsDB(EngineParams params);
85 void initPluginLoader(EngineParams params);
87 std::map<std::string, archive_function> getMediaPluginMap();
89 Plugin* getUIPlugin(std::string preferred = "");
90 UI* getUI(std::string preferred = "d");
92 void runGame(GameData, std::string, MediaLoader);
96 #endif