WindowApiEventManagerFactory.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * author: Patrick-Christopher Mattulat
  3. * e-mail: webmaster@lynarstudios.com
  4. */
  5. #include <factory/WindowApiEventManagerFactory.hpp>
  6. #include <ls-std/core/exception/IllegalArgumentException.hpp>
  7. #include <window/SdlWindowApiEventManager.hpp>
  8. using ls::atlantis::factory::WindowApiEventManagerFactory;
  9. using ls::atlantis::glossary::WindowApiTypes;
  10. using ls::atlantis::interfaces::IWindowApiEventManager;
  11. using ls::atlantis::window::SdlWindowApiEventManager;
  12. using ls::std::core::IllegalArgumentException;
  13. using ::std::make_shared;
  14. using ::std::shared_ptr;
  15. WindowApiEventManagerFactory::WindowApiEventManagerFactory() = default;
  16. WindowApiEventManagerFactory::~WindowApiEventManagerFactory() = default;
  17. shared_ptr<IWindowApiEventManager> WindowApiEventManagerFactory::build(const WindowApiTypes &_windowApi)
  18. {
  19. shared_ptr<IWindowApiEventManager> eventManager{};
  20. switch (_windowApi)
  21. {
  22. case WindowApiTypes::NONE_SELECTED:
  23. {
  24. throw IllegalArgumentException{};
  25. }
  26. case WindowApiTypes::SDL_WINDOW_API:
  27. {
  28. eventManager = make_shared<SdlWindowApiEventManager>();
  29. } break;
  30. }
  31. return eventManager;
  32. }