/* * author: Patrick-Christopher Mattulat * e-mail: webmaster@lynarstudios.com */ #include #include #include #include using ls::atlantis::cycle::Engine; using ls::atlantis::cycle::EngineParameter; using ls::atlantis::cycle::EngineRuntimeData; using ls::atlantis::factory::KeyboardFactory; using ls::atlantis::factory::WindowApiFactory; using ls::atlantis::interfaces::AStatusCode; using ls::atlantis::messaging::StatusCodeOk; using ::std::make_shared; using ::std::shared_ptr; Engine::Engine(const EngineParameter &_parameter) : data(make_shared()), parameter(_parameter) {} Engine::~Engine() = default; shared_ptr Engine::getData() const { return this->data; } shared_ptr Engine::init() const { shared_ptr result = _initWindowApi(); if (result->getCode() == StatusCodeOk().getCode()) { result = this->_initKeyboard(); } return result; } shared_ptr Engine::_initKeyboard() const { const auto keyboard = KeyboardFactory::build(this->parameter.getWindowApiType()); this->data->setKeyboard(keyboard); return make_shared(); } shared_ptr Engine::_initWindowApi() const { const auto windowApi = WindowApiFactory::build(this->parameter.getWindowApiType()); this->data->setWindowApi(windowApi); return windowApi->init(); }