(NDK) Fixed copy/move constructor/operator
Former-commit-id: e51e7cab650aa7c17141f7401fbcbdf3159aec2b
This commit is contained in:
parent
f137a75267
commit
2ab0defa48
|
|
@ -22,12 +22,17 @@ namespace Ndk
|
||||||
using Factory = std::function<BaseComponent*()>;
|
using Factory = std::function<BaseComponent*()>;
|
||||||
|
|
||||||
BaseComponent(ComponentIndex componentIndex);
|
BaseComponent(ComponentIndex componentIndex);
|
||||||
|
BaseComponent(const BaseComponent&) = default;
|
||||||
|
BaseComponent(BaseComponent&&) noexcept = default;
|
||||||
virtual ~BaseComponent();
|
virtual ~BaseComponent();
|
||||||
|
|
||||||
virtual BaseComponent* Clone() const = 0;
|
virtual BaseComponent* Clone() const = 0;
|
||||||
|
|
||||||
ComponentIndex GetIndex() const;
|
ComponentIndex GetIndex() const;
|
||||||
|
|
||||||
|
BaseComponent& operator=(const BaseComponent&) = default;
|
||||||
|
BaseComponent& operator=(BaseComponent&&) noexcept = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ComponentIndex m_componentIndex;
|
ComponentIndex m_componentIndex;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,9 @@ namespace Ndk
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BaseSystem(SystemIndex systemId);
|
BaseSystem(SystemIndex systemId);
|
||||||
virtual ~BaseSystem();
|
BaseSystem(const BaseSystem&);
|
||||||
|
BaseSystem(BaseSystem&&) noexcept = default;
|
||||||
|
~BaseSystem();
|
||||||
|
|
||||||
virtual BaseSystem* Clone() const = 0;
|
virtual BaseSystem* Clone() const = 0;
|
||||||
|
|
||||||
|
|
@ -35,6 +37,9 @@ namespace Ndk
|
||||||
|
|
||||||
bool HasEntity(const Entity* entity) const;
|
bool HasEntity(const Entity* entity) const;
|
||||||
|
|
||||||
|
BaseSystem& operator=(const BaseSystem&) = delete;
|
||||||
|
BaseSystem& operator=(BaseSystem&&) noexcept = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
template<typename ComponentType> void Excludes();
|
template<typename ComponentType> void Excludes();
|
||||||
template<typename ComponentType1, typename ComponentType2, typename... Rest> void Excludes();
|
template<typename ComponentType1, typename ComponentType2, typename... Rest> void Excludes();
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline BaseSystem::BaseSystem(const BaseSystem& system) :
|
||||||
|
m_excludedComponents(system.m_excludedComponents),
|
||||||
|
m_requiredComponents(system.m_requiredComponents),
|
||||||
|
m_systemIndex(system.m_systemIndex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
inline const std::vector<EntityHandle>& BaseSystem::GetEntities() const
|
inline const std::vector<EntityHandle>& BaseSystem::GetEntities() const
|
||||||
{
|
{
|
||||||
return m_entities;
|
return m_entities;
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,15 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
System();
|
System();
|
||||||
|
System(const System&) = default;
|
||||||
|
System(System&&) = default;
|
||||||
virtual ~System();
|
virtual ~System();
|
||||||
|
|
||||||
BaseSystem* Clone() const override;
|
BaseSystem* Clone() const override;
|
||||||
|
|
||||||
|
System& operator=(const System&) = delete;
|
||||||
|
System& operator=(System&&) = default;
|
||||||
|
|
||||||
static SystemIndex RegisterSystem();
|
static SystemIndex RegisterSystem();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,5 +30,4 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
return GetNextIndex();
|
return GetNextIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue