00001 /* This file is part of Annchienta. 00002 * Copyright 2008 (C) Jasper Van der Jeugt 00003 * 00004 * Annchienta is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * Annchienta is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with Annchienta. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef ANNCHIENTA_ENGINE_H 00019 #define ANNCHIENTA_ENGINE_H 00020 00021 #define SMALL_STRING_SIZE 128 00022 #define DEFAULT_STRING_SIZE 512 00023 #define LARGE_STRING_SIZE 1024 00024 00025 namespace Annchienta 00026 { 00027 00028 class LogManager; 00029 class VideoManager; 00030 class InputManager; 00031 class MapManager; 00032 class AudioManager; 00033 class CacheManager; 00034 class MathManager; 00035 00040 class Engine 00041 { 00042 private: 00043 LogManager *logManager; 00044 VideoManager *videoManager; 00045 InputManager *inputManager; 00046 MapManager *mapManager; 00047 AudioManager *audioManager; 00048 CacheManager *cacheManager; 00049 MathManager *mathManager; 00050 00051 char writeDirectory[DEFAULT_STRING_SIZE]; 00052 00053 bool pythonBoolean; 00054 00055 public: 00056 #ifndef SWIG 00057 00060 Engine( const char *writeDirectory="." ); 00061 ~Engine(); 00062 00067 void runPythonCode( const char *code ) const; 00068 00073 void runPythonScript( const char *filename ) const; 00074 00082 bool evaluatePythonBoolean( const char *code, const char *conditional ); 00083 00089 void toPythonCode( char **code ); 00090 #endif 00091 00095 const char *getWriteDirectory() const; 00096 00104 void setWriteDirectory( const char *directory ); 00105 00112 void write( const char *text ) const; 00113 00118 bool isValidFile( const char *filename ) const; 00119 00123 void setWindowTitle( const char *title ) const; 00124 00128 unsigned int getTicks() const; 00129 00133 void delay( int ms ) const; 00134 00139 void setPythonBoolean( bool b ); 00140 }; 00141 00146 void init( const char *writeDir="." ); 00147 00150 void quit(); 00151 00154 Engine *getEngine(); 00155 }; 00156 00157 #endif 00158