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

@@ -32,7 +32,6 @@
#include <Nazara/Core/AbstractHash.hpp>
#include <Nazara/Core/AbstractLogger.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/AppFilesystemComponent.hpp>
#include <Nazara/Core/Application.hpp>
#include <Nazara/Core/ApplicationBase.hpp>
#include <Nazara/Core/ApplicationComponent.hpp>
@@ -48,6 +47,7 @@
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/DynLib.hpp>
#include <Nazara/Core/EmptyStream.hpp>
#include <Nazara/Core/EntitySystemAppComponent.hpp>
#include <Nazara/Core/EntityWorld.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/EnvironmentVariables.hpp>
@@ -55,6 +55,7 @@
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Core/File.hpp>
#include <Nazara/Core/FileLogger.hpp>
#include <Nazara/Core/FilesystemAppComponent.hpp>
#include <Nazara/Core/Format.hpp>
#include <Nazara/Core/Functor.hpp>
#include <Nazara/Core/GuillotineBinPack.hpp>
@@ -103,7 +104,6 @@
#ifdef NAZARA_ENTT
#include <Nazara/Core/AppEntitySystemComponent.hpp>
#include <Nazara/Core/Components.hpp>
#include <Nazara/Core/EnttSystemGraph.hpp>
#include <Nazara/Core/EnttWorld.hpp>

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)

View File

@@ -25,8 +25,8 @@
namespace Nz
{
class AppFilesystemComponent;
class CommandLineParameters;
class FilesystemAppComponent;
class RenderBuffer;
class NAZARA_GRAPHICS_API Graphics : public ModuleBase<Graphics>
@@ -68,7 +68,7 @@ namespace Nz
inline std::shared_ptr<nzsl::FilesystemModuleResolver>& GetShaderModuleResolver();
inline const std::shared_ptr<nzsl::FilesystemModuleResolver>& GetShaderModuleResolver() const;
void RegisterComponent(AppFilesystemComponent& component);
void RegisterComponent(FilesystemAppComponent& component);
struct NAZARA_GRAPHICS_API Config
{

View File

@@ -29,7 +29,6 @@
#ifndef NAZARA_GLOBAL_PLATFORM_HPP
#define NAZARA_GLOBAL_PLATFORM_HPP
#include <Nazara/Platform/AppWindowingComponent.hpp>
#include <Nazara/Platform/Clipboard.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Cursor.hpp>
@@ -45,5 +44,6 @@
#include <Nazara/Platform/WindowEvent.hpp>
#include <Nazara/Platform/WindowEventHandler.hpp>
#include <Nazara/Platform/WindowHandle.hpp>
#include <Nazara/Platform/WindowingAppComponent.hpp>
#endif // NAZARA_GLOBAL_PLATFORM_HPP

View File

@@ -4,8 +4,8 @@
#pragma once
#ifndef NAZARA_PLATFORM_APPWINDOWINGCOMPONENT_HPP
#define NAZARA_PLATFORM_APPWINDOWINGCOMPONENT_HPP
#ifndef NAZARA_PLATFORM_WINDOWINGAPPCOMPONENT_HPP
#define NAZARA_PLATFORM_WINDOWINGAPPCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/ApplicationComponent.hpp>
@@ -14,13 +14,13 @@
namespace Nz
{
class NAZARA_PLATFORM_API AppWindowingComponent : public ApplicationComponent
class NAZARA_PLATFORM_API WindowingAppComponent : public ApplicationComponent
{
public:
inline AppWindowingComponent(ApplicationBase& app);
AppWindowingComponent(const AppWindowingComponent&) = delete;
AppWindowingComponent(AppWindowingComponent&&) = delete;
~AppWindowingComponent() = default;
inline WindowingAppComponent(ApplicationBase& app);
WindowingAppComponent(const WindowingAppComponent&) = delete;
WindowingAppComponent(WindowingAppComponent&&) = delete;
~WindowingAppComponent() = default;
template<typename... Args> Window& CreateWindow(Args&&... args);
@@ -31,8 +31,8 @@ namespace Nz
void Update(Time elapsedTime) override;
AppWindowingComponent& operator=(const AppWindowingComponent&) = delete;
AppWindowingComponent& operator=(AppWindowingComponent&&) = delete;
WindowingAppComponent& operator=(const WindowingAppComponent&) = delete;
WindowingAppComponent& operator=(WindowingAppComponent&&) = delete;
private:
std::vector<std::unique_ptr<Window>> m_windows;
@@ -40,6 +40,6 @@ namespace Nz
};
}
#include <Nazara/Platform/AppWindowingComponent.inl>
#include <Nazara/Platform/WindowingAppComponent.inl>
#endif // NAZARA_PLATFORM_APPWINDOWINGCOMPONENT_HPP
#endif // NAZARA_PLATFORM_WINDOWINGAPPCOMPONENT_HPP

View File

@@ -7,28 +7,28 @@
namespace Nz
{
template<typename... Args>
Window& AppWindowingComponent::CreateWindow(Args&&... args)
Window& WindowingAppComponent::CreateWindow(Args&&... args)
{
return *m_windows.emplace_back(std::make_unique<Window>(std::forward<Args>(args)...));
}
inline AppWindowingComponent::AppWindowingComponent(ApplicationBase& app) :
inline WindowingAppComponent::WindowingAppComponent(ApplicationBase& app) :
ApplicationComponent(app),
m_quitOnLastWindowClosed(true)
{
}
inline void AppWindowingComponent::DisableQuitOnLastWindowClosed()
inline void WindowingAppComponent::DisableQuitOnLastWindowClosed()
{
return EnableQuitOnLastWindowClosed(false);
}
inline void AppWindowingComponent::EnableQuitOnLastWindowClosed(bool enable)
inline void WindowingAppComponent::EnableQuitOnLastWindowClosed(bool enable)
{
m_quitOnLastWindowClosed = enable;
}
inline bool AppWindowingComponent::IsQuitOnLastWindowClosedEnabled() const
inline bool WindowingAppComponent::IsQuitOnLastWindowClosedEnabled() const
{
return m_quitOnLastWindowClosed;
}