Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Level.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "NonCopyable.hpp"
4 
5 #include <string>
6 
7 namespace Fling
8 {
9  class World;
10 
15  class Level : public NonCopyable
16  {
17  public:
22  explicit Level(const std::string& t_LevelFile, World* t_OwningWorld);
23  ~Level();
24 
31  void Update(float t_DeltaTime);
32 
36  void Unload();
37 
43  World* GetOwningWorld() const { return m_OwningWorld; }
44 
45  private:
46 
47  // BSPTree m_Model;
48  // std::vector<Actor> m_ActiveActors;
49 
51  std::string m_LevelFileName = "UNLOADED";
52 
56  void LoadLevel();
57 
61  void PostLoad();
62 
64  World* m_OwningWorld = nullptr;
65  };
66 } // namespace Fling
A level contains active objects and provides the environment for the player.
Definition: Level.h:15
void PostLoad()
Any behavior that needs to happen after the level has been fully loaded.
Definition: Level.cpp:45
~Level()
Definition: Level.cpp:50
std::string m_LevelFileName
The path to the level file (should be a full path, NOT relative to assets dir)
Definition: Level.h:51
World * GetOwningWorld() const
Get the Owning World object of this level.
Definition: Level.h:43
The world holds all active levels in the game.
Definition: World.h:17
void Unload()
Unload the current level and all actors inside of it.
Definition: Level.cpp:64
World * m_OwningWorld
The owning work that this level exists in.
Definition: Level.h:64
Class that removes the copy operator and constructor.
Definition: NonCopyable.hpp:10
Level(const std::string &t_LevelFile, World *t_OwningWorld)
Loads this level based on the given file name.
Definition: Level.cpp:9
Definition: Engine.h:13
void Update(float t_DeltaTime)
Update the BSP of actors and tick every active actor.
Definition: Level.cpp:56
void LoadLevel()
Load the level based on the current file name!
Definition: Level.cpp:20