From 2cac13706691be289f93e619179a6bb218e95063 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 14 Oct 2017 14:41:55 +0200 Subject: [PATCH] Sdk: Remove systems clone (and thus need for copy constructor) --- SDK/include/NDK/BaseSystem.hpp | 4 +--- SDK/include/NDK/BaseSystem.inl | 18 ------------------ SDK/include/NDK/System.hpp | 4 +--- SDK/include/NDK/System.inl | 16 ---------------- SDK/include/NDK/Systems/RenderSystem.inl | 11 ----------- SDK/src/NDK/Systems/PhysicsSystem2D.cpp | 12 ------------ SDK/src/NDK/Systems/PhysicsSystem3D.cpp | 12 ------------ 7 files changed, 2 insertions(+), 75 deletions(-) diff --git a/SDK/include/NDK/BaseSystem.hpp b/SDK/include/NDK/BaseSystem.hpp index abd4081c9..18cbef454 100644 --- a/SDK/include/NDK/BaseSystem.hpp +++ b/SDK/include/NDK/BaseSystem.hpp @@ -22,14 +22,12 @@ namespace Ndk public: inline BaseSystem(SystemIndex systemId); - inline BaseSystem(const BaseSystem&); + BaseSystem(const BaseSystem&) = delete; BaseSystem(BaseSystem&&) noexcept = default; virtual ~BaseSystem(); inline void Enable(bool enable = true); - virtual std::unique_ptr Clone() const = 0; - bool Filters(const Entity* entity) const; inline const EntityList& GetEntities() const; diff --git a/SDK/include/NDK/BaseSystem.inl b/SDK/include/NDK/BaseSystem.inl index c537fbca1..560b06584 100644 --- a/SDK/include/NDK/BaseSystem.inl +++ b/SDK/include/NDK/BaseSystem.inl @@ -23,24 +23,6 @@ namespace Ndk SetMaximumUpdateRate(30); } - /*! - * \brief Constructs a BaseSystem object by copy semantic - * - * \param system System to copy - */ - - inline BaseSystem::BaseSystem(const BaseSystem& system) : - m_excludedComponents(system.m_excludedComponents), - m_requiredComponents(system.m_requiredComponents), - m_systemIndex(system.m_systemIndex), - m_updateEnabled(system.m_updateEnabled), - m_fixedUpdateRate(system.m_fixedUpdateRate), - m_maxUpdateRate(system.m_maxUpdateRate), - m_updateCounter(0.f), - m_updateOrder(system.m_updateOrder) - { - } - /*! * \brief Enables the system * diff --git a/SDK/include/NDK/System.hpp b/SDK/include/NDK/System.hpp index 935362763..b828d1fcb 100644 --- a/SDK/include/NDK/System.hpp +++ b/SDK/include/NDK/System.hpp @@ -16,12 +16,10 @@ namespace Ndk { public: System(); - System(const System&) = default; + System(const System&) = delete; System(System&&) = default; virtual ~System(); - std::unique_ptr Clone() const override; - System& operator=(const System&) = delete; System& operator=(System&&) = default; diff --git a/SDK/include/NDK/System.inl b/SDK/include/NDK/System.inl index b3927d145..65bbe0907 100644 --- a/SDK/include/NDK/System.inl +++ b/SDK/include/NDK/System.inl @@ -28,22 +28,6 @@ namespace Ndk template System::~System() = default; - /*! - * \brief Clones the system - * \return The clone newly created - * - * \remark The system to clone should be trivially copy constructible - */ - - template - std::unique_ptr System::Clone() const - { - ///FIXME: Not fully supported in GCC (4.9.2) - //static_assert(std::is_trivially_copy_constructible::value, "SystemType should be copy-constructible"); - - return std::make_unique(static_cast(*this)); - } - /*! * \brief Registers the system by assigning it an index */ diff --git a/SDK/include/NDK/Systems/RenderSystem.inl b/SDK/include/NDK/Systems/RenderSystem.inl index 8a443f993..aa5c6bdae 100644 --- a/SDK/include/NDK/Systems/RenderSystem.inl +++ b/SDK/include/NDK/Systems/RenderSystem.inl @@ -4,17 +4,6 @@ namespace Ndk { - /*! - * \brief Constructs a RenderSystem object by copy semantic - * - * \param renderSystem RenderSystem to copy - */ - - inline RenderSystem::RenderSystem(const RenderSystem& renderSystem) : - System(renderSystem) - { - } - /*! * \brief Changes the render technique used for the system * \return A reference to the render technique type diff --git a/SDK/src/NDK/Systems/PhysicsSystem2D.cpp b/SDK/src/NDK/Systems/PhysicsSystem2D.cpp index 2616b185f..b05815a89 100644 --- a/SDK/src/NDK/Systems/PhysicsSystem2D.cpp +++ b/SDK/src/NDK/Systems/PhysicsSystem2D.cpp @@ -31,18 +31,6 @@ namespace Ndk Excludes(); } - /*! - * \brief Constructs a PhysicsSystem object by copy semantic - * - * \param system PhysicsSystem to copy - */ - - PhysicsSystem2D::PhysicsSystem2D(const PhysicsSystem2D& system) : - System(system), - m_world() - { - } - void PhysicsSystem2D::CreatePhysWorld() const { NazaraAssert(!m_world, "Physics world should not be created twice"); diff --git a/SDK/src/NDK/Systems/PhysicsSystem3D.cpp b/SDK/src/NDK/Systems/PhysicsSystem3D.cpp index 3b4706cc2..9026c5a1d 100644 --- a/SDK/src/NDK/Systems/PhysicsSystem3D.cpp +++ b/SDK/src/NDK/Systems/PhysicsSystem3D.cpp @@ -31,18 +31,6 @@ namespace Ndk Excludes(); } - /*! - * \brief Constructs a PhysicsSystem object by copy semantic - * - * \param system PhysicsSystem to copy - */ - - PhysicsSystem3D::PhysicsSystem3D(const PhysicsSystem3D& system) : - System(system), - m_world() - { - } - void PhysicsSystem3D::CreatePhysWorld() const { NazaraAssert(!m_world, "Physics world should not be created twice");