00001 /* 00002 SagaEngine library 00003 Copyright (c) 2002-2006 Skalden Studio AS 00004 00005 This software is provided 'as-is', without any express or implied 00006 warranty. In no event will the authors be held liable for any 00007 damages arising from the use of this software. 00008 00009 Permission is granted to distribute the library under the terms of the 00010 Q Public License version 1.0. Be sure to read and understand the license 00011 before using the library. It should be included here, or you may read it 00012 at http://www.trolltech.com/products/qt/licenses/licensing/qpl 00013 00014 The original version of this library can be located at: 00015 http://www.sagaengine.com/ 00016 00017 Rune Myrland 00018 rune@skalden.com 00019 */ 00020 00021 00022 #ifndef sim_SimEngine_hpp 00023 #define sim_SimEngine_hpp 00024 00025 #include "sim.hpp" 00026 #include "./config/sim_config.hpp" 00027 #include "./stat/sim_stat.hpp" 00028 #include "./thing/sim_thing.hpp" 00029 #include "./area/sim_area.hpp" 00030 #include "util/vecmath/Vector3.hpp" 00031 #include "util/vecmath/Point3.hpp" 00032 00033 00034 namespace se_core { 00035 00041 class _SeCoreExport SimEngine { 00042 public: 00046 SimEngine(); 00047 00051 ~SimEngine(); 00052 00060 static bool init(); 00061 00062 const char* level() { return level_.get(); } 00063 const char* nextLevel() { return nextLevel_.get(); } 00064 00065 00073 void cleanup(); 00074 00075 00082 void initGame(); 00083 00084 00092 void cleanupGame(); 00093 00094 void setLevel(const char* name); 00095 00105 bool step(long when); 00106 00107 00113 void go(); 00114 00115 00119 void resetAll(); 00120 00121 00125 void resetTimer() { previousPerform_ = 0; } 00126 00127 00143 void setMultiplePerformsPerStepEnabled(bool state); 00144 00145 00153 inline long when() { 00154 return (previousPerform_ - lostPerformAdjustment_) << TIMESTEP_INTERVAL_SHIFT; 00155 } 00156 00162 bool isGameOver() { return isGameOver_; } 00163 00169 void setGameOver(bool state); 00170 00171 protected: 00192 void perform(long when); 00193 00194 00195 private: 00199 long previousPerform_; 00200 00204 bool isGameOver_; 00205 00212 bool multiplePerformsPerStepEnabled_; 00213 00217 bool multiplePerformsDisabledOnce_; 00218 00222 long lostPerformAdjustment_; 00223 00224 String level_, nextLevel_; 00225 }; 00226 00227 } 00228 00229 #endif
Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:12 2007 by Doxygen version 1.3.9.1.