World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
EngineConfigFactory.h
См. документацию.
1 #pragma once
2 
3 #include <functional>
4 #include <memory>
5 #include <string>
6 
7 #include "Engine/EngineConfig.h"
8 #include "Engine/IocContainer.h"
9 #include "Engine/Log.h"
10 
12 
13 namespace Engine_ {
14 
16  public:
18  this->log = EngineIoc::ResolveLogger();
19  }
20 
21  std::shared_ptr<EngineConfig> Create();
22  std::shared_ptr<EngineConfig> CreateFromCommandLine(const std::string &cmd);
23  std::shared_ptr<EngineConfig> Clone(std::shared_ptr<const EngineConfig> other);
24  std::shared_ptr<EngineConfig> Mutate(
25  std::shared_ptr<const EngineConfig> config,
26  std::function<void(std::shared_ptr<EngineConfig> &)> mutator);
27 
28  private:
29  std::shared_ptr<EngineConfig> CreateDefaultConfiguration();
30 
31  Log *log = nullptr;
32 };
33 
34 } // namespace Engine_
Engine_::IocContainer
Definition: IocContainer.h:15
IocContainer.h
Engine_
Definition: EngineConfig.h:33
Engine_::EngineConfigFactory::CreateFromCommandLine
std::shared_ptr< EngineConfig > CreateFromCommandLine(const std::string &cmd)
Definition: EngineConfigFactory.cpp:87
Engine_::IocContainer::ResolveLogger
static Log * ResolveLogger()
Definition: IocContainer.cpp:51
Log
Definition: Log.h:3
Engine_::EngineConfigFactory::log
Log * log
Definition: EngineConfigFactory.h:31
Engine_::EngineConfigFactory
Definition: EngineConfigFactory.h:15
EngineConfig.h
Engine_::EngineConfigFactory::Clone
std::shared_ptr< EngineConfig > Clone(std::shared_ptr< const EngineConfig > other)
Definition: EngineConfigFactory.cpp:69
Engine_::EngineConfigFactory::Create
std::shared_ptr< EngineConfig > Create()
Definition: EngineConfigFactory.cpp:83
Engine_::EngineConfigFactory::CreateDefaultConfiguration
std::shared_ptr< EngineConfig > CreateDefaultConfiguration()
Definition: EngineConfigFactory.cpp:12
Engine_::EngineConfigFactory::EngineConfigFactory
EngineConfigFactory()
Definition: EngineConfigFactory.h:17
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:691
Log.h
config
EGLConfig config
Definition: SDL_egl.h:1149
Engine_::EngineConfigFactory::Mutate
std::shared_ptr< EngineConfig > Mutate(std::shared_ptr< const EngineConfig > config, std::function< void(std::shared_ptr< EngineConfig > &)> mutator)
Definition: EngineConfigFactory.cpp:73