| 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
Fling::Level
A level contains active objects and provides the environment for the player.
Definition: Level.h:15
Fling::Level::PostLoad
void PostLoad()
Any behavior that needs to happen after the level has been fully loaded.
Definition: Level.cpp:45
Fling::Level::~Level
~Level()
Definition: Level.cpp:50
Fling::Level::m_LevelFileName
std::string m_LevelFileName
The path to the level file (should be a full path, NOT relative to assets dir)
Definition: Level.h:51
Fling::Level::GetOwningWorld
World * GetOwningWorld() const
Get the Owning World object of this level.
Definition: Level.h:43
NonCopyable.hpp
Fling::World
The world holds all active levels in the game.
Definition: World.h:21
Fling::Level::Unload
void Unload()
Unload the current level and all actors inside of it.
Definition: Level.cpp:64
Fling::Level::m_OwningWorld
World * m_OwningWorld
The owning work that this level exists in.
Definition: Level.h:64
Fling::NonCopyable
Class that removes the copy operator and constructor.
Definition: NonCopyable.hpp:10
Fling::Level::Level
Level(const std::string &t_LevelFile, World *t_OwningWorld)
Loads this level based on the given file name.
Definition: Level.cpp:9
Fling
Definition: Engine.h:29
Fling::Level::Update
void Update(float t_DeltaTime)
Update the BSP of actors and tick every active actor.
Definition: Level.cpp:56
Fling::Level::LoadLevel
void LoadLevel()
Load the level based on the current file name!
Definition: Level.cpp:20