This commit is contained in:
h4570
2022-07-30 14:48:59 +02:00
parent 52a19f11a5
commit b7b32fb35a
25 changed files with 792 additions and 21 deletions
+40
View File
@@ -0,0 +1,40 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <engine.hpp>
using Tyra::Engine;
namespace Demo {
template <typename StateTypeT>
class State {
public:
State(Engine* t_engine) : engine(t_engine) {}
virtual ~State() {}
virtual const StateTypeT& getState() const = 0;
virtual const bool& wantFinish() const = 0;
virtual void onStart() = 0;
virtual void update() = 0;
/** @return Next game state */
virtual StateTypeT onFinish() = 0;
protected:
Engine* engine;
};
} // namespace Demo