Skip to content

Latest commit

 

History

History
58 lines (36 loc) · 867 Bytes

_entity_8hpp.md

File metadata and controls

58 lines (36 loc) · 867 Bytes
title
src/ecs/Entity.hpp

src/ecs/Entity.hpp

Namespaces

Name
ecs

Classes

Name
class ecs::Entity

Source code

#pragma once

#include <cstddef>

namespace ecs
{
    class Entity {
      public:
        friend class Registry;

        explicit operator size_t &() { return _id; }
        explicit operator size_t() const { return _id; }

      private:
        explicit Entity(size_t id) : _id(id) {}

        size_t &operator=(const std::size_t &id)
        {
            _id = id;
            return _id;
        }

        std::size_t _id;
    };
} // namespace ecs

Updated on 2022-11-13 at 17:21:37 +0100