Rename AppComponent classes (AppEntitySystemComponent => EntitySystemAppComponent)

This commit is contained in:
SirLynix
2024-01-24 16:50:04 +01:00
parent 3421c0f50b
commit bb3b28279b
25 changed files with 89 additions and 89 deletions

View File

@@ -4,8 +4,8 @@
#pragma once
#ifndef NAZARA_CORE_APPENTITYSYSTEMCOMPONENT_HPP
#define NAZARA_CORE_APPENTITYSYSTEMCOMPONENT_HPP
#ifndef NAZARA_CORE_ENTITYSYSTEMAPPCOMPONENT_HPP
#define NAZARA_CORE_ENTITYSYSTEMAPPCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/ApplicationComponent.hpp>
@@ -14,26 +14,26 @@
namespace Nz
{
class NAZARA_CORE_API AppEntitySystemComponent : public ApplicationComponent
class NAZARA_CORE_API EntitySystemAppComponent : public ApplicationComponent
{
public:
using ApplicationComponent::ApplicationComponent;
AppEntitySystemComponent(const AppEntitySystemComponent&) = delete;
AppEntitySystemComponent(AppEntitySystemComponent&&) = delete;
~AppEntitySystemComponent() = default;
EntitySystemAppComponent(const EntitySystemAppComponent&) = delete;
EntitySystemAppComponent(EntitySystemAppComponent&&) = delete;
~EntitySystemAppComponent() = default;
template<typename T, typename... Args> T& AddWorld(Args&&... args);
void Update(Time elapsedTime) override;
AppEntitySystemComponent& operator=(const AppEntitySystemComponent&) = delete;
AppEntitySystemComponent& operator=(AppEntitySystemComponent&&) = delete;
EntitySystemAppComponent& operator=(const EntitySystemAppComponent&) = delete;
EntitySystemAppComponent& operator=(EntitySystemAppComponent&&) = delete;
private:
std::vector<std::unique_ptr<EntityWorld>> m_worlds;
};
}
#include <Nazara/Core/AppEntitySystemComponent.inl>
#include <Nazara/Core/EntitySystemAppComponent.inl>
#endif // NAZARA_CORE_APPENTITYSYSTEMCOMPONENT_HPP
#endif // NAZARA_CORE_ENTITYSYSTEMAPPCOMPONENT_HPP

View File

@@ -7,7 +7,7 @@
namespace Nz
{
template<typename T, typename... Args>
T& AppEntitySystemComponent::AddWorld(Args&&... args)
T& EntitySystemAppComponent::AddWorld(Args&&... args)
{
return static_cast<T&>(*m_worlds.emplace_back(std::make_unique<T>(std::forward<Args>(args)...)));
}

View File

@@ -4,8 +4,8 @@
#pragma once
#ifndef NAZARA_CORE_APPFILESYSTEMCOMPONENT_HPP
#define NAZARA_CORE_APPFILESYSTEMCOMPONENT_HPP
#ifndef NAZARA_CORE_FILESYSTEMAPPCOMPONENT_HPP
#define NAZARA_CORE_FILESYSTEMAPPCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/ApplicationComponent.hpp>
@@ -17,13 +17,13 @@
namespace Nz
{
class NAZARA_CORE_API AppFilesystemComponent : public ApplicationComponent
class NAZARA_CORE_API FilesystemAppComponent : public ApplicationComponent
{
public:
inline AppFilesystemComponent(ApplicationBase& app);
AppFilesystemComponent(const AppFilesystemComponent&) = delete;
AppFilesystemComponent(AppFilesystemComponent&&) = delete;
~AppFilesystemComponent() = default;
inline FilesystemAppComponent(ApplicationBase& app);
FilesystemAppComponent(const FilesystemAppComponent&) = delete;
FilesystemAppComponent(FilesystemAppComponent&&) = delete;
~FilesystemAppComponent() = default;
template<typename T> const typename T::Params* GetDefaultResourceParameters() const;
inline VirtualDirectoryPtr GetDirectory(std::string_view assetPath);
@@ -41,8 +41,8 @@ namespace Nz
template<typename T> void SetDefaultResourceParameters(typename T::Params params);
AppFilesystemComponent& operator=(const AppFilesystemComponent&) = delete;
AppFilesystemComponent& operator=(AppFilesystemComponent&&) = delete;
FilesystemAppComponent& operator=(const FilesystemAppComponent&) = delete;
FilesystemAppComponent& operator=(FilesystemAppComponent&&) = delete;
private:
template<typename T, typename... ExtraArgs> std::shared_ptr<T> LoadImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args);
@@ -53,6 +53,6 @@ namespace Nz
};
}
#include <Nazara/Core/AppFilesystemComponent.inl>
#include <Nazara/Core/FilesystemAppComponent.inl>
#endif // NAZARA_CORE_APPFILESYSTEMCOMPONENT_HPP
#endif // NAZARA_CORE_FILESYSTEMAPPCOMPONENT_HPP

View File

@@ -19,13 +19,13 @@ namespace Nz
struct ResourceParameterHasMerge<T, std::void_t<decltype(std::declval<T>().Merge(std::declval<T>()))>> : std::true_type {};
}
inline AppFilesystemComponent::AppFilesystemComponent(ApplicationBase& app) :
inline FilesystemAppComponent::FilesystemAppComponent(ApplicationBase& app) :
ApplicationComponent(app)
{
}
template<typename T>
const typename T::Params* AppFilesystemComponent::GetDefaultResourceParameters() const
const typename T::Params* FilesystemAppComponent::GetDefaultResourceParameters() const
{
constexpr UInt64 typeHash = FNV1a64(TypeName<T>());
@@ -36,7 +36,7 @@ namespace Nz
return static_cast<const typename T::Params*>(it->second.get());
}
VirtualDirectoryPtr AppFilesystemComponent::GetDirectory(std::string_view assetPath)
VirtualDirectoryPtr FilesystemAppComponent::GetDirectory(std::string_view assetPath)
{
VirtualDirectoryPtr dir;
m_rootDirectory->GetDirectoryEntry(assetPath, [&](const Nz::VirtualDirectory::DirectoryEntry& dirEntry)
@@ -48,13 +48,13 @@ namespace Nz
}
template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::Load(std::string_view assetPath, ExtraArgs&&... args)
std::shared_ptr<T> FilesystemAppComponent::Load(std::string_view assetPath, ExtraArgs&&... args)
{
return Load<T>(assetPath, typename T::Params{}, std::forward<ExtraArgs>(args)...);
}
template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::Load(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args)
std::shared_ptr<T> FilesystemAppComponent::Load(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args)
{
if constexpr (Detail::ResourceParameterHasMerge<typename T::Params>::value)
{
@@ -66,13 +66,13 @@ namespace Nz
}
template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::Open(std::string_view assetPath, ExtraArgs&&... args)
std::shared_ptr<T> FilesystemAppComponent::Open(std::string_view assetPath, ExtraArgs&&... args)
{
return Open<T>(assetPath, typename T::Params{}, std::forward<ExtraArgs>(args)...);
}
template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::Open(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args)
std::shared_ptr<T> FilesystemAppComponent::Open(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args)
{
if constexpr (Detail::ResourceParameterHasMerge<typename T::Params>::value)
{
@@ -84,7 +84,7 @@ namespace Nz
}
template<typename T>
void AppFilesystemComponent::SetDefaultResourceParameters(typename T::Params params)
void FilesystemAppComponent::SetDefaultResourceParameters(typename T::Params params)
{
constexpr UInt64 typeHash = FNV1a64(TypeName<T>());
@@ -92,7 +92,7 @@ namespace Nz
}
template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::LoadImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args)
std::shared_ptr<T> FilesystemAppComponent::LoadImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args)
{
std::shared_ptr<T> resource;
if (!m_rootDirectory)
@@ -123,7 +123,7 @@ namespace Nz
}
template<typename T, typename... ExtraArgs>
std::shared_ptr<T> AppFilesystemComponent::OpenImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args)
std::shared_ptr<T> FilesystemAppComponent::OpenImpl(std::string_view assetPath, const typename T::Params& params, ExtraArgs&&... args)
{
std::shared_ptr<T> resource;
if (!m_rootDirectory)