checkpoint
This commit is contained in:
parent
949342892c
commit
48e33df61b
|
|
@ -0,0 +1,12 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace math
|
||||||
|
{
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
class Rect
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace math
|
||||||
|
{
|
||||||
|
template<typename T>
|
||||||
|
class Vec2
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
private:
|
||||||
|
T x;
|
||||||
|
T y;
|
||||||
|
};
|
||||||
|
|
||||||
|
using Vec2f = Vec2<float>;
|
||||||
|
using Vec2i = Vec2<int>;
|
||||||
|
|
||||||
|
}//namespace
|
||||||
|
|
@ -1,37 +1,42 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Scenes/MainMenu.h"
|
||||||
#include <ConstGlobals.h>
|
#include <ConstGlobals.h>
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
#include <Scenes.h>
|
#include <Scenes.h>
|
||||||
|
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
|
enum class Scenes : int
|
||||||
|
{
|
||||||
|
Play,
|
||||||
|
MainMenu,
|
||||||
|
SceneCount
|
||||||
|
};
|
||||||
|
|
||||||
|
inline constexpr int SCENE_COUNT {(int)Scenes::SceneCount};
|
||||||
|
|
||||||
using SceneContainer = std::tuple
|
using SceneContainer = std::tuple
|
||||||
<
|
<
|
||||||
Play_s
|
Play_s,
|
||||||
|
MainMenu_s
|
||||||
>;
|
>;
|
||||||
|
|
||||||
class GameEngine
|
class GameEngine
|
||||||
{
|
{
|
||||||
public:
|
private:
|
||||||
void changeScene(Scene* scene_in)
|
void changeScene(Scenes scene_in);
|
||||||
{
|
|
||||||
m_previousScene = m_currentScene;
|
|
||||||
m_currentScene = scene_in;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scene* getCurrentScene()
|
public:
|
||||||
{
|
void run();
|
||||||
return m_currentScene;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
sf::RenderWindow m_window;
|
sf::RenderWindow m_window;
|
||||||
SceneContainer m_scenes;
|
SceneContainer m_scenes;
|
||||||
Scene* m_currentScene;
|
Scenes m_currentScene;
|
||||||
Scene* m_previousScene;
|
Scenes m_previousScene;
|
||||||
bool m_running;
|
bool m_running;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Scenes/Scene.h>
|
#include <Scenes/Scene.h>
|
||||||
#include <Scenes/Play.h>
|
#include <Scenes/Play.h>
|
||||||
|
#include <Scenes/MainMenu.h>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class MainMenu_s
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue