> For the complete documentation index, see [llms.txt](https://cavonstavants-organization.gitbook.io/rtype-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cavonstavants-organization.gitbook.io/rtype-technical-documentation/index_classes/classecs_1_1_world.md).

# ecs::World

[More...](#detailed-description)

`#include <World.hpp>`

## Public Functions

|                                                                                                                                   | Name                                                                                                                                                                                                                                                                                                             |
| --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                                                                                                                   | [**World**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md#function-world)()                                                                                                                                                                      |
| void                                                                                                                              | [**runSystems**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md#function-runsystems)()                                                                                                                                                            |
| void                                                                                                                              | [**addSystem**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md#function-addsystem)(const std::function< void([World](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md) &)> & system) |
| void                                                                                                                              | [**pushEvent**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md#function-pushevent)(const [ecs::Event](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_event.md) event)                       |
| const [ecs::Event](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_event.md) | [**getEvent**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md#function-getevent)() const                                                                                                                                                          |
| const [ecs::Event](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_event.md) | [**popEvent**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md#function-popevent)()                                                                                                                                                                |

## Public Attributes

|                                                                                                                              | Name                                                                                                                                            |
| ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [Registry](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_registry.md) | [**registry**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md#variable-registry) |

## Detailed Description

```cpp
class ecs::World;
```

[World](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_world.md) class is used to contain all the components that are relevant to work together

## Public Functions Documentation

### function World

```cpp
inline World()
```

Default constructor

### function runSystems

```cpp
inline void runSystems()
```

Used to operate all the systems in the world

### function addSystem

```cpp
inline void addSystem(
    const std::function< void(World &)> & system
)
```

**Parameters**:

* **system** The system you want to add in the world in a constant manner

USed to add a new system into the world

### function pushEvent

```cpp
inline void pushEvent(
    const ecs::Event event
)
```

**Parameters**:

* **event** The event you want to push in the world

Used to add a new event into the world

### function getEvent

```cpp
inline const ecs::Event getEvent() const
```

**Return**: The first event of the private stack if it exists, ecs::Event::EventType::Null otherwise

Used to get the first event of the private stack \_events

### function popEvent

```cpp
inline const ecs::Event popEvent()
```

**Return**: The event you just popped out of the stack if it exists, ecs::Event::EventType::Null otherwise

Used to pop the first event of the private stack \_events

## Public Attributes Documentation

### variable registry

```cpp
Registry registry;
```

The registry of the world, refers to the [Registry](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classecs_1_1_registry.md) documentation to learn more about it

***

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