/* * author: Patrick-Christopher Mattulat * e-mail: webmaster@lynarstudios.com */ #include #include #include using ls::atlantis::factory::KeyboardFactory; using ls::atlantis::glossary::KeyboardKeys; using ls::atlantis::glossary::WindowApiTypes; using ls::atlantis::input::KeyStatus; using ls::atlantis::input::KeyboardKeyMap; using ls::atlantis::input::SdlKeyboard; using ls::atlantis::interfaces::IKeyboard; using ls::std::core::IllegalArgumentException; using ::std::make_shared; using ::std::shared_ptr; KeyboardFactory::KeyboardFactory() = default; KeyboardFactory::~KeyboardFactory() = default; shared_ptr KeyboardFactory::build(const WindowApiTypes &_windowApi) { shared_ptr keyboard{}; switch (_windowApi) { case WindowApiTypes::NONE_SELECTED: { throw IllegalArgumentException{}; } case WindowApiTypes::SDL_WINDOW_API: { keyboard = make_shared(KeyboardFactory::_generateKeyMap()); } break; } return keyboard; } KeyboardKeyMap KeyboardFactory::_generateKeyMap() { KeyboardKeyMap keyMap{}; keyMap[KeyboardKeys::ESCAPE] = KeyStatus(KeyboardKeys::ESCAPE, false, false); return keyMap; }