SimSchema.cpp

Go to the documentation of this file.
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 #include "SimSchema.hpp"
00023 #include "../InitListeners.hpp"
00024 #include "../SimListeners.hpp"
00025 #include "../SimEngine.hpp"
00026 #include "comp/Composite.hpp"
00027 #include "comp/node/RootComponent.hpp"
00028 #include "../action/Action.hpp"
00029 #include "../action/ActionQueue.hpp"
00030 #include "../action/ActionManager.hpp"
00031 #include "../script/ShowingCutscene.hpp"
00032 #include "../script/ScriptManager.hpp"
00033 #include "../message/MessageCentral.hpp"
00034 #include "../message/SoundCentral.hpp"
00035 #include "../stat/HealthListeners.hpp"
00036 #include "../area/sim_area.hpp"
00037 #include "../area/AreaManager.hpp"
00038 #include "../spawn/SpawnManager.hpp"
00039 #include "../physics/all.hpp"
00040 #include "../react/all.hpp"
00041 #include "../action/all.hpp"
00042 #include "../signal/SignalManager.hpp"
00043 #include "../stat/Dictionary.hpp"
00044 #include "../stat/DictionaryEntry.hpp"
00045 #include "util/system/util_system.hpp"
00046 #include "util/error/StopWatch.hpp"
00047 #include "util/system/RealClock.hpp"
00048 #include <cstring>
00049 
00050 
00051 namespace se_core {
00052     namespace SimSchema {
00053         SimEngine simEngine;
00054         AreaManager areaManager;
00055 
00056         SpawnManager& spawnManager() {
00057             return SpawnManager::singleton();
00058         }
00059 
00060         InitListeners& initListeners() {
00061             static InitListeners initListeners;
00062             return initListeners;
00063         }
00064 
00065         SimListeners& engineListeners() {
00066             static SimListeners simListeners;
00067             return simListeners;
00068         }
00069         
00070 
00071         HealthListeners& healthListeners() {
00072             static HealthListeners healthListeners;
00073             return healthListeners;
00074         }
00075 
00076         ActionQueue actionQueue[CHANNEL_COUNT];
00077 
00078         //StopWatch defaultStopWatch OBJECT_IN_EWRAM;
00079         //StopWatch* stopWatch = &defaultStopWatch;
00080 
00081         MessageCentral messageCentral;
00082         
00083         SoundCentral soundCentral;
00084 
00085         Dictionary& dictionary() {
00086             static Dictionary d;
00087             return d;
00088         }
00089 
00090         ShowingCutscene showingCutscene;
00091         RealClock* realClock = 0;
00092 
00093         const char* appName = 0;
00094         int scriptTracker = 0;
00095         bool didTrack = false;
00096         int speechCount = 0;
00097 
00098 
00099         bool init(const char* applicationName) {
00100             appName = applicationName;
00101             static DictionaryEntry dDictionaryType(DE_DICTIONARY_TYPE, DE_DICTIONARY_TYPE, "DICTIONARY_TYPE", false);
00102             static DictionaryEntry dTagType(DE_DICTIONARY_TYPE, DE_TAG, "TAG", false);
00103             static DictionaryEntry dSubstanceType(DE_DICTIONARY_TYPE, DE_SUBSTANCE, "SUBSTANCE", false);
00104             static DictionaryEntry dThingType(DE_DICTIONARY_TYPE, DE_THING_TYPE, "THING_TYPE", false);
00105             static DictionaryEntry dMovementMode(DE_DICTIONARY_TYPE, DE_MOVEMENT_MODE, "MOVEMENT_MODE", false);
00106             static DictionaryEntry dFirstUserType(DE_DICTIONARY_TYPE, DE_FIRST_USER_TYPE, "FIRST_USER_TYPE", false);
00107 
00108             PhysicsManager::singleton();
00109             ScriptManager::singleton();
00110             ActionManager::singleton();
00111             SpawnManager::singleton();
00112             CollisionManager::singleton();
00113             SignalManager::singleton();
00114 
00115             return simEngine.init();
00116         }
00117 
00118         void cleanup() {
00119             return simEngine.cleanup();
00120         }
00121 
00122 
00123         void touch() {
00124             // The core has no dependencies
00125         }
00126     }
00127 }

Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:11 2007 by Doxygen version 1.3.9.1.

SourceForge.net Logo