Skip to content

Commit

Permalink
List external tools licenses and improved general documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasLrx committed Nov 14, 2024
1 parent e1bbbc9 commit f1525ae
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 34 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@endcond TURN_OFF_DOXYGEN
-->

### Introduction
## Introduction

Ecstasy is a modern C++ library that implements an Entity Component System (ECS) architecture with a strong focus on performance, flexibility, and ease of use.

Expand All @@ -47,7 +47,7 @@ Some key features include:

Get started with Ecstasy today and experience a new level of performance and productivity in your ECS-based projects!

### Code Example
## Code Example

_The following is a basic example extracted from the [Tutorial](https://andreaslrx.github.io/ecstasy/md_doc_2_tutorial.html)._

Expand Down Expand Up @@ -100,11 +100,11 @@ int main() {
}
```

### Building
## Building

Follow the [building documentation](https://andreaslrx.github.io/ecstasy/md_doc_2_building.html)

### Documentation
## Documentation

You can see the documentation [online](https://andreaslrx.github.io/ecstasy/).

Expand All @@ -118,17 +118,26 @@ doxygen
xdg-open doc/build/html/index.html
```

### Contributing
## Contributing

ECSTASY is an open source project. If you want to get involved and suggest some additional features, file a bug report or submit a patch, create an issue or submit a pull request.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
If you want to contribute with pull requests, look at the [Contributing.md](/CONTRIBUTING.md)

### License
## License

The ECSTASY library is distributed under the [MIT license](https://opensource.org/licenses/MIT).
In short, ECSTASY is free for any use (commercial or personal, proprietary or open-source). You can use ECSTASY in your project without any restriction. You can even omit to mention that you use ECSTASY -- although it would be appreciated.

### Authors
### External tools License

Some of ECSTASY parts use external tools. Therefore their licenses extend to your project if you use the associated [options](https://andreaslrx.github.io/ecstasy/md_doc_2_building.html#CMakeOptions).

- [Google Tests](https://github.com/google/googletest/) [[BSD 3-Clause](https://github.com/google/googletest/blob/main/LICENSE)]: BUILD_TEST_SUITE
- [Rapidjson](https://github.com/Tencent/rapidjson/) [[MIT](https://github.com/Tencent/rapidjson/blob/master/license.txt)]: ECSTASY_SERIALIZER_JSON
- [Toml++](https://github.com/marzer/tomlplusplus/) [[MIT](https://github.com/marzer/tomlplusplus/blob/master/LICENSE)]: ECSTASY_SERIALIZER_TOML (Also induced by ECSTASY_INTEGRATIONS_USER_ACTION)
- [SFML](https://github.com/SFML/SFML/) [[ZLIB](https://github.com/SFML/SFML/blob/master/license.md)]: ECSTASY_INTEGRATIONS_SFML

## Authors

- Andréas Leroux ([email protected])
14 changes: 6 additions & 8 deletions doc/Building.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Building

To build Ecstasy project from sources, follow these steps:

### Prerequisites
## Prerequisites

1. Install [CMake](https://cmake.org/resources/) (version 3.19 or higher)
2. Install a C++ compiler with [C++20](https://en.cppreference.com/w/cpp/20) support (Ex: G++ 8, Clang 14 or MSVC 2022)

### Build Steps
## Build Steps

1. Clone the Ecstasy repository

Expand All @@ -27,11 +25,11 @@ To build Ecstasy project from sources, follow these steps:
cmake --build build --config Release -j
```

#### IDEs
### IDEs

The library may also be built with any IDE that has [CMakePresets.json](/CMakePresets.json) support, such as Visual Sudio, VSCode + CMake Tools, or CLion.
The library may also be built with any IDE that has [CMakePresets.json](https://github.com/AndreasLrx/ecstasy/blob/main/CMakePresets.json) support, such as Visual Sudio, VSCode + CMake Tools, or CLion.

### Using as a CMake package
## Using as a CMake package

I recommand using ecstasy as a CMake package. This allows easier static link and if you want to use SFML it is contained in ecstasy with the **ECSTASY_INTEGRATIONS_SFML** option.
An example project may be done one day to have a concrete CMake example. If you want, feel free to do it and I will link it here (or even better, make a PR)
Expand Down Expand Up @@ -87,7 +85,7 @@ _I am writing these lines because I suffered too much with CMake and if it can s
target_link_libraries(my_super_target PUBLIC ecstasy)
```

### CMake options
## CMake options {#CMakeOptions}

You can find more details about the options and their dependencies in [Options.cmake](/cmake/Options.cmake). <br>
_In case this documentation is not up to date with the [Options.cmake](/cmake/Options.cmake) file, open an issue._
Expand Down
39 changes: 23 additions & 16 deletions doc/Glossary.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Glossary
# Glossary {#GlossaryStart}

This page will help you define the various concepts used in ecstasy (most are common to other ECS).
This page will help you understand the various concepts used in ecstasy (most are common to other ECS).
Do not hesitate to create an issue if a definition is still complicated or if a complex term is missing.

If you're not familiar with the concept of ECS, go see this quite complete general FAQ [here](https://github.com/SanderMertens/ecs-faq).

The following definitions may be redundant for common notions but will also explain ECSTASY specific concepts.

## Entity

An entity represents a distinct object or item in the registry. It is an abstract, unique identifier that groups together components to define its characteristics and behavior.
Entities in an ECS can be seen as a link between multiple components.

References: [Entity](@ref ecstasy::Entity), [Entities](@ref ecstasy::Entities)
References: [Entity](@ref ecstasy::Entity), [RegistryEntity](@ref ecstasy::RegistryEntity), [Entities](@ref ecstasy::Entities)

## Component

Expand All @@ -23,15 +27,17 @@ struct Position {
};
```
@note
There is almost no constraint on component types in ECSTASY, so you can use external library classes as components.
## Storage
A storage is a component container. It is used to store and manage components. It organizes components for efficient access and iteration during system execution, facilitating quick retrieval and manipulation of entity data.
A storage is a component container. It is used to store and manage components and their associated entity identifier. It organizes components for efficient access and iteration during system execution, facilitating quick retrieval and manipulation of entity data.
@note
Ecstasy currently implements a single storage type: [MapStorage](@ref ecstasy::MapStorage).
However you can create [custom storages](#CustomStorageTutorial).
Ecstasy already implements some storage types but you can also create [your own](#CustomStorageTutorial).
References: [IStorage](@ref ecstasy::IStorage), [getStorageType](@ref ecstasy::getStorageType), [IsStorage](@ref ecstasy::IsStorage), [MapStorage](@ref ecstasy::MapStorage), [Registry.addStorage()](@ref ecstasy::Registry::addStorage)
References: @ref ecstasy::IStorage "IStorage", @ref ecstasy::AStorage, @ref ecstasy::MapStorage "MapStorage", @ref ecstasy::MarkerStorage "MarkerStorage", @ref ecstasy::VectorStorage "VectorStorage", @ref ecstasy::IsStorage "IsStorage", @ref ecstasy::getStorageType "getStorageType", @ref ecstasy::Registry::addStorage "Registry.addStorage()"
## System
Expand All @@ -55,7 +61,7 @@ References: [ISystem](@ref ecstasy::ISystem), [Registry.addSystem()](@ref ecstas

## Resource

A resource is a shared and globally accessible piece of data that can be utilized by systems or entities in the ECS. Resources typically represent data that is not tied to a specific entity but is needed by various parts of the [registry](@ref ecstasy::Registry), such as configuration settings or global parameters.
A resource is a shared and globally accessible piece of data that can be used by systems or entities in the ECS. Resources typically represent data that is not tied to a specific entity but is needed by various parts of the [registry](@ref ecstasy::Registry), such as configuration settings or global parameters.

@note
In ecstasy, the [Entities](@ref ecstasy::Entities) class is a resource present by default in the [registry](@ref ecstasy::Registry).
Expand Down Expand Up @@ -104,6 +110,7 @@ References: [IResource](@ref ecstasy::IResource), [registry.addResource()](@ref
## Registry

The registry is a centralized database or manager responsible for creating, managing, and tracking entities within the ECS. It maintains the relationships between entities and their components and provides essential functionality for entity lifecycle management.
Sometimes called a `world` in other ECS frameworks.

The registry contains:

Expand Down Expand Up @@ -158,9 +165,9 @@ concept Queryable = requires(Q &queryable, Q const &cqueryable, std::size_t inde
};
```

In fact there is multiple Queryable sub concepts such as [QueryableObject](@ref ecstasy::query::Queryable) (example above), [ConstQueryableObject](@ref ecstasy::query::ConstQueryableObject) and [QueryableWrapper](@ref ecstasy::query::QueryableWrapper). A Queryable must validate at least one of the said concepts.
In fact there is multiple @ref ecstasy::query::Queryable "Queryable" sub concepts such as [QueryableObject](@ref ecstasy::query::QueryableObject) (example above), [ConstQueryableObject](@ref ecstasy::query::ConstQueryableObject) and [QueryableWrapper](@ref ecstasy::query::QueryableWrapper). A Queryable must validate at least one of the said concepts.

References: [Queryable](@ref ecstasy::query::Queryable), [Queryable](@ref ecstasy::query::Queryable), [ConstQueryableObject](@ref ecstasy::query::ConstQueryableObject), [QueryableWrapper](@ref ecstasy::query::QueryableWrapper)
References: [Queryable](@ref ecstasy::query::Queryable), [QueryableObject](@ref ecstasy::query::QueryableObject), [ConstQueryableObject](@ref ecstasy::query::ConstQueryableObject), [QueryableWrapper](@ref ecstasy::query::QueryableWrapper)

### Batch Query

Expand Down Expand Up @@ -255,12 +262,12 @@ The condition cannot works if the evaluated type is not in the query queryables.

Ecstasy provides the following conditions:

- [EqualTo =](@ref ecstasy::EqualTo)
- [NotEqualTo !=](@ref ecstasy::NotEqualTo)
- [Greater >](@ref ecstasy::Greater)
- [GreaterEqual >=](@ref ecstasy::GreaterEqual)
- [Less <](@ref ecstasy::Less)
- [LessEqual <=](@ref ecstasy::LessEqual)
- [EqualTo (=)](@ref ecstasy::EqualTo)
- [NotEqualTo (!=)](@ref ecstasy::NotEqualTo)
- [Greater (>)](@ref ecstasy::Greater)
- [GreaterEqual (>=)](@ref ecstasy::GreaterEqual)
- [Less (<)](@ref ecstasy::Less)
- [LessEqual (<=)](@ref ecstasy::LessEqual)

And here is a little example where the two loops does the same thing:

Expand Down
7 changes: 4 additions & 3 deletions doc/Tutorial.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Tutorial

@note
The tutorials on this page will help you to use ecstasy, not to understands the concepts and terms. I strongly advise you to look at the [glossary](@ref Glossary.md) before following any tutorials (except the getting started).
The tutorials on this page will help you to use ecstasy, not to understands the concepts and terms. I strongly advise you to look at the [glossary](https://andreaslrx.github.io/ecstasy/md_doc_2_glossary.html) before following any tutorials (except the getting started).

## Getting Started {#GettingStarted}

Expand All @@ -15,7 +15,8 @@ The usual order when using ecstasy is the following:
- Run the registry systems with [runSystems](@ref ecstasy::Registry::runSystems)

In this example we create 10 entities. Every entities have a position component and only even entities have a velocity component.
The Movement system will iterate on every entities having a position **and** a velocity component and add the velocity vector to the position. (Know this is not a perfect approach because the velocity should depend on the elapsed time)
The Movement system will iterate on every entities having a position **and** a velocity component and add the velocity vector to the position. (Know this is not a perfect approach because the velocity should depend on the elapsed time).

Finally we run the systems over and over.

```cpp
Expand Down Expand Up @@ -71,7 +72,7 @@ int main() {

### Creating entities

There is 3 ways to create new entities in the registry:
There are 3 ways to create new entities in the registry:

- Using the [registry](@ref ecstasy::Registry) [builder](@ref ecstasy::Registry::EntityBuilder)
- Using the [entities](@ref ecstasy::Entities) [builder](@ref ecstasy::Entities::Builder)
Expand Down

0 comments on commit f1525ae

Please sign in to comment.