Sdk: Remove systems clone (and thus need for copy constructor)

This commit is contained in:
Lynix 2017-10-14 14:41:55 +02:00
parent 101783126c
commit 2cac137066
7 changed files with 2 additions and 75 deletions

View File

@ -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<BaseSystem> Clone() const = 0;
bool Filters(const Entity* entity) const;
inline const EntityList& GetEntities() const;

View File

@ -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
*

View File

@ -16,12 +16,10 @@ namespace Ndk
{
public:
System();
System(const System&) = default;
System(const System&) = delete;
System(System&&) = default;
virtual ~System();
std::unique_ptr<BaseSystem> Clone() const override;
System& operator=(const System&) = delete;
System& operator=(System&&) = default;

View File

@ -28,22 +28,6 @@ namespace Ndk
template<typename SystemType>
System<SystemType>::~System() = default;
/*!
* \brief Clones the system
* \return The clone newly created
*
* \remark The system to clone should be trivially copy constructible
*/
template<typename SystemType>
std::unique_ptr<BaseSystem> System<SystemType>::Clone() const
{
///FIXME: Not fully supported in GCC (4.9.2)
//static_assert(std::is_trivially_copy_constructible<SystemType>::value, "SystemType should be copy-constructible");
return std::make_unique<SystemType>(static_cast<const SystemType&>(*this));
}
/*!
* \brief Registers the system by assigning it an index
*/

View File

@ -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

View File

@ -31,18 +31,6 @@ namespace Ndk
Excludes<PhysicsComponent3D>();
}
/*!
* \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");

View File

@ -31,18 +31,6 @@ namespace Ndk
Excludes<PhysicsComponent2D>();
}
/*!
* \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");