2
Copyright (C) 2002 Hans H�ggstr�m
3
Copyright (C) 2005 Erik Hjortsberg
5
This program 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 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or 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 this program; if not, write to the Free Software
17
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
#include "EmberServices.h"
26
//#include "test/TestService.h"
27
#include "logging/LoggingService.h"
28
#include "config/ConfigService.h"
29
#include "input/InputService.h"
30
//#include "gui/GuiService.h"
31
#include "sound/SoundService.h"
32
#include "metaserver/MetaserverService.h"
33
#include "server/ServerService.h"
34
#include "scripting/ScriptingService.h"
35
#include "wfut/WfutService.h"
36
#include "time/TimeService.h"
42
template<> Ember::EmberServices* Ember::Singleton<Ember::EmberServices>::ms_Singleton = 0;
45
EmberServices::~EmberServices()
50
// TestService* EmberServices::getTestService()
56
LoggingService* EmberServices::getLoggingService()
58
return mLoggingService->getService();
61
ConfigService* EmberServices::getConfigService()
63
return mConfigService->getService();
66
InputService* EmberServices::getInputService()
68
return mInputService->getService();
73
GuiService* EmberServices::getGuiService()
75
if (myGuiService == NULL)
76
myGuiService = new Ember::GuiService();
81
MetaserverService* EmberServices::getMetaserverService()
83
return mMetaserverService->getService();
86
ServerService* EmberServices::getServerService()
88
return mServerService->getService();
91
SoundService* EmberServices::getSoundService()
93
return mSoundService->getService();
96
ScriptingService* EmberServices::getScriptingService()
98
return mScriptingService->getService();
101
Ember::WfutService* EmberServices::getWfutService()
103
return mWfutService->getService();
106
Ember::Services::Time* EmberServices::getTimeService()
108
return mTimeService->getService();
111
EmberServices::EmberServices()
112
: mScriptingService(std::auto_ptr<ServiceContainer<ScriptingService> >(new ServiceContainer<ScriptingService>()) )
113
, mSoundService(std::auto_ptr<ServiceContainer<SoundService> >(new ServiceContainer<SoundService>()) )
114
, mServerService(std::auto_ptr<ServiceContainer<ServerService> >(new ServiceContainer<ServerService>()) )
115
, mMetaserverService(std::auto_ptr<ServiceContainer<MetaserverService> >(new ServiceContainer<MetaserverService>()) )
116
, mInputService(std::auto_ptr<ServiceContainer<InputService> >(new ServiceContainer<InputService>()) )
117
, mWfutService(std::auto_ptr<ServiceContainer<WfutService> >(new ServiceContainer<WfutService>()) )
118
, mConfigService(std::auto_ptr<ServiceContainer<ConfigService> >(new ServiceContainer<ConfigService>()) )
119
, mTimeService(std::auto_ptr<ServiceContainer<Services::Time> >(new ServiceContainer<Services::Time>()) )