Core: Add StateMachine

Backported from legacy Nazara
This commit is contained in:
SirLynix
2023-05-07 22:42:54 +02:00
parent 24e546a808
commit c69397707e
5 changed files with 318 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_CORE_STATE_HPP
#define NAZARA_CORE_STATE_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Time.hpp>
namespace Nz
{
class StateMachine;
class NAZARA_CORE_API State
{
public:
State() = default;
virtual ~State();
virtual void Enter(StateMachine& fsm) = 0;
virtual void Leave(StateMachine& fsm) = 0;
virtual bool Update(StateMachine& fsm, Time elapsedTime) = 0;
};
}
#endif // NAZARA_CORE_STATE_HPP