mirror of
https://github.com/BlackMATov/ecs.hpp.git
synced 2025-12-14 19:01:24 +07:00
explicit copy ctors
This commit is contained in:
34
ecs.hpp
34
ecs.hpp
@@ -667,11 +667,14 @@ namespace ecs_hpp
|
|||||||
{
|
{
|
||||||
class entity final {
|
class entity final {
|
||||||
public:
|
public:
|
||||||
|
entity(registry& owner) noexcept;
|
||||||
|
entity(registry& owner, entity_id id) noexcept;
|
||||||
|
|
||||||
entity(const entity&) = default;
|
entity(const entity&) = default;
|
||||||
entity& operator=(const entity&) = default;
|
entity& operator=(const entity&) = default;
|
||||||
|
|
||||||
entity(registry& owner) noexcept;
|
entity(entity&&) noexcept = default;
|
||||||
entity(registry& owner, entity_id id) noexcept;
|
entity& operator=(entity&&) noexcept = default;
|
||||||
|
|
||||||
registry& owner() noexcept;
|
registry& owner() noexcept;
|
||||||
const registry& owner() const noexcept;
|
const registry& owner() const noexcept;
|
||||||
@@ -751,14 +754,17 @@ namespace ecs_hpp
|
|||||||
{
|
{
|
||||||
class const_entity final {
|
class const_entity final {
|
||||||
public:
|
public:
|
||||||
const_entity(const const_entity&) = default;
|
|
||||||
const_entity& operator=(const const_entity&) = default;
|
|
||||||
|
|
||||||
const_entity(const entity& ent) noexcept;
|
const_entity(const entity& ent) noexcept;
|
||||||
|
|
||||||
const_entity(const registry& owner) noexcept;
|
const_entity(const registry& owner) noexcept;
|
||||||
const_entity(const registry& owner, entity_id id) noexcept;
|
const_entity(const registry& owner, entity_id id) noexcept;
|
||||||
|
|
||||||
|
const_entity(const const_entity&) = default;
|
||||||
|
const_entity& operator=(const const_entity&) = default;
|
||||||
|
|
||||||
|
const_entity(const_entity&&) noexcept = default;
|
||||||
|
const_entity& operator=(const_entity&&) noexcept = default;
|
||||||
|
|
||||||
const registry& owner() const noexcept;
|
const registry& owner() const noexcept;
|
||||||
entity_id id() const noexcept;
|
entity_id id() const noexcept;
|
||||||
|
|
||||||
@@ -817,10 +823,13 @@ namespace ecs_hpp
|
|||||||
template < typename T >
|
template < typename T >
|
||||||
class component final {
|
class component final {
|
||||||
public:
|
public:
|
||||||
|
component(const entity& owner) noexcept;
|
||||||
|
|
||||||
component(const component&) = default;
|
component(const component&) = default;
|
||||||
component& operator=(const component&) = default;
|
component& operator=(const component&) = default;
|
||||||
|
|
||||||
component(const entity& owner) noexcept;
|
component(component&&) noexcept = default;
|
||||||
|
component& operator=(component&&) noexcept = default;
|
||||||
|
|
||||||
entity& owner() noexcept;
|
entity& owner() noexcept;
|
||||||
const entity& owner() const noexcept;
|
const entity& owner() const noexcept;
|
||||||
@@ -877,11 +886,14 @@ namespace ecs_hpp
|
|||||||
template < typename T >
|
template < typename T >
|
||||||
class const_component final {
|
class const_component final {
|
||||||
public:
|
public:
|
||||||
|
const_component(const component<T>& comp) noexcept;
|
||||||
|
const_component(const const_entity& owner) noexcept;
|
||||||
|
|
||||||
const_component(const const_component&) = default;
|
const_component(const const_component&) = default;
|
||||||
const_component& operator=(const const_component&) = default;
|
const_component& operator=(const const_component&) = default;
|
||||||
|
|
||||||
const_component(const component<T>& comp) noexcept;
|
const_component(const_component&&) noexcept = default;
|
||||||
const_component(const const_entity& owner) noexcept;
|
const_component& operator=(const_component&&) noexcept = default;
|
||||||
|
|
||||||
const const_entity& owner() const noexcept;
|
const const_entity& owner() const noexcept;
|
||||||
|
|
||||||
@@ -989,6 +1001,12 @@ namespace ecs_hpp
|
|||||||
registry() = default;
|
registry() = default;
|
||||||
~registry() noexcept = default;
|
~registry() noexcept = default;
|
||||||
|
|
||||||
|
registry(const registry& other) = delete;
|
||||||
|
registry& operator=(const registry& other) = delete;
|
||||||
|
|
||||||
|
registry(registry&& other) noexcept = default;
|
||||||
|
registry& operator=(registry&& other) noexcept = default;
|
||||||
|
|
||||||
entity wrap_entity(const const_uentity& ent) noexcept;
|
entity wrap_entity(const const_uentity& ent) noexcept;
|
||||||
const_entity wrap_entity(const const_uentity& ent) const noexcept;
|
const_entity wrap_entity(const const_uentity& ent) const noexcept;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user