LevelLoader.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * 2D Game Engine
  3. * LevelLoader.h:
  4. * Based on pikuma.com 2D game engine in C++ and Lua course
  5. * Copyright (c) 2021 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 28/02/2021.
  8. */
  9. #ifndef IMGUI_SOURCE_INCLUDE_LEVELLOADER_H
  10. #define IMGUI_SOURCE_INCLUDE_LEVELLOADER_H
  11. #include <memory>
  12. #include <SDL.h>
  13. #include <ECS.h>
  14. #include <AssetStore.h>
  15. struct LevelLoader
  16. {
  17. private:
  18. void loadAssetTable(sol::table &assetsTable,
  19. const std::unique_ptr<AssetStore> &assetStore,
  20. SDL_Renderer *renderer);
  21. void loadTileMap(sol::table &tileMap,
  22. const std::unique_ptr<Registry> &registry);
  23. void loadEntities(sol::table &entitiesTable,
  24. const std::unique_ptr<Registry> &registry);
  25. public:
  26. LevelLoader();
  27. ~LevelLoader();
  28. void LoadLevel(sol::state &lua,
  29. const std::unique_ptr<Registry> &registry,
  30. const std::unique_ptr<AssetStore> &assetStore,
  31. SDL_Renderer *renderer,
  32. int levelNumber);
  33. };
  34. #endif /* IMGUI_SOURCE_INCLUDE_LEVELLOADER_H */