Utility: Add velocity component and system

This commit is contained in:
SirLynix
2022-07-02 19:43:58 +02:00
parent 99b4397d78
commit d5f70279a1
7 changed files with 175 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_UTILITY_SYSTEMS_VELOCITYSYSTEM_HPP
#define NAZARA_UTILITY_SYSTEMS_VELOCITYSYSTEM_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utils/TypeList.hpp>
#include <entt/entt.hpp>
namespace Nz
{
class NAZARA_UTILITY_API VelocitySystem
{
public:
using Components = TypeList<class NodeComponent, class VelocityComponent>;
inline VelocitySystem(entt::registry& registry);
VelocitySystem(const VelocitySystem&) = delete;
VelocitySystem(VelocitySystem&&) = delete;
~VelocitySystem() = default;
void Update(float elapsedTime);
VelocitySystem& operator=(const VelocitySystem&) = delete;
VelocitySystem& operator=(VelocitySystem&&) = delete;
private:
entt::registry& m_registry;
};
}
#include <Nazara/Utility/Systems/VelocitySystem.inl>
#endif // NAZARA_UTILITY_SYSTEMS_VELOCITYSYSTEM_HPP