# Entity

This class encapsulates an entity in the Entity Component System (ECS), which is essentially a unique identifier that can be associated with various components to represent objects in the game world.

```cpp
class Entity {
public:
    /**
     * @brief Construct a new Entity object with a unique identifier.
     * 
     * @param id The unique identifier for the entity.
     */
    explicit Entity(int id) : id_(id) {}

    /**
     * @brief Get the unique identifier for the entity.
     * 
     * @return The identifier of the entity as an integer.
     */
    int id() const { return id_; }

private:
    int id_; ///< The unique identifier for the entity
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://r-type-5.gitbook.io/r-type/development-guidelines/ecs/entity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
