revert to old tab notation
@@ -4,8 +4,6 @@ This document provides a quick overview of Flecs features.
## World
The world is the container for all of your ECS data. An application can have multiple worlds. To create & delete a world, simply do:
-=== "C"
-
```c
ecs_world_t *world = ecs_init();
@@ -13,9 +11,6 @@ The world is the container for all of your ECS data. An application can have mul
ecs_fini(world);
```
-
-=== "C++"
-
```cpp
flecs::world world();
@@ -25,24 +20,18 @@ The world is the container for all of your ECS data. An application can have mul
## Entities
An entity (`ecs_entity_t`) is a 64-bit integer that uniquely identifies a thing or object in your application. Entities are created like this:
-=== "C"
```c
ecs_entity_t e = ecs_new(world, 0);
```
-
-=== "C++"
```cpp
auto e = flecs::entity(world);
```
You can also use plain numbers:
-=== "C"
```c
ecs_entity_t e = 1000;
```
-
-=== "C++"
```cpp
auto e = flecs::entity(world, 1000);
```
@@ -52,7 +41,6 @@ When not using an explicit id, the framework guarantees that the returned id is
## Components
A component is a plain datatype that can be attached to an entity. An entity can contain any number of components. Components must be registered with the world like this:
-=== "C"
```c
// Components can be defined from regular types
typedef struct Position {
@@ -66,8 +54,6 @@ A component is a plain datatype that can be attached to an entity. An entity can
ECS_COMPONENT(world, Position);
}
```
-
-=== "C++"
```cpp
// Components can be defined from regular types
struct Position {
@@ -84,36 +70,27 @@ A component is a plain datatype that can be attached to an entity. An entity can
Once registered, a component can be added to an entity using `add`:
-=== "C"
```c
ecs_add(world, e, Position);
```
-
-=== "C++"
```cpp
e.add<Position>();
```
You can also create an entity with a component already added:
-=== "C"
```c
ecs_entity_t e = ecs_new(world, Position);
```
-
-=== "C++"
```cpp
auto e = flecs::entity(world).add<Position>();
```
An application can also use `set` to assign a value to the component. If the component was not added yet, `set` will add it implicitly:
-=== "C"
```c
ecs_set(world, e, Position, {10, 20});
```
-
-=== "C++"
```cpp
e.set<Position>({10, 20});
```
