Entity

What is an entity, how do we use it...

As we said in the introduction, an entity is a distinct object representing an actor in a simulated space. It has not actual data or behavior. This Component gives an entity its data. It is typically a struct or dictionary.

Entity class

class Entity {
    public:
        explicit Entity(std::size_t id) : _id(id) {};
        ~Entity();
        operator std::size_t() const { return _id; }

    private:
        std::size_t _id;
};

You can see above the struct used to create an entity in our ECS.

Finally, an entity is save as an ID (size_t).

Last updated