https://github.com/friflo/friflo.engine-docs
API Reference for ECS (Entity Component System) Friflo.Engine.ECS
https://github.com/friflo/friflo.engine-docs
csharp ecs ecs-framework entity-component-system
Last synced: 6 months ago
JSON representation
API Reference for ECS (Entity Component System) Friflo.Engine.ECS
- Host: GitHub
- URL: https://github.com/friflo/friflo.engine-docs
- Owner: friflo
- License: agpl-3.0
- Created: 2024-01-21T13:10:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-13T12:10:30.000Z (10 months ago)
- Last Synced: 2024-12-13T12:38:53.833Z (10 months ago)
- Topics: csharp, ecs, ecs-framework, entity-component-system
- Homepage: https://github.com/friflo/Friflo.Engine.ECS
- Size: 6.54 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/friflo/Friflo.Engine.ECS) 
[](https://github.com/friflo/Friflo.Engine.ECS)
[](https://github.com/friflo/Friflo.Engine.ECS-Demos)
[](https://friflo.gitbook.io/friflo.engine.ecs)# **Friflo.Engine.ECS · API Reference**
This project contains the C# API reference of [**Friflo Engine ECS - GitHub**](https://github.com/friflo/Friflo.Engine.ECS).
| Namespace | Description |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [Friflo.Engine.ECS](api/Friflo.Engine.ECS.md) | Contains types and methods to query, add, remove or change [Entity](api/Entity.md)'s in an [EntityStore](api/EntityStore.md). |
| [Friflo.Engine.ECS.Collections](api/Friflo.Engine.ECS.Collections.md) | Contains types to enable data binding for common .NET applications. |
| [Friflo.Engine.ECS.Index](api/Friflo.Engine.ECS.Index.md) | Enables search for indexed component values in O(1) for types: string, int, enum, float, Guid, DateTime, ....
Support efficient entity relationships like entity links (foreign keys) and back links (JOIN's).|
| [Friflo.Engine.ECS.Serialize](api/Friflo.Engine.ECS.Serialize.md) | Contains types and methods to serialize / deserialize [Entity](api/Entity.md)'s as JSON. |
| [Friflo.Engine.ECS.Systems](api/Friflo.Engine.ECS.Systems.md) | Used to organize and execute a set of systems within a [SystemRoot](api/SystemRoot.md). |
| [Friflo.Engine.ECS.Utils](api/Friflo.Engine.ECS.Utils.md) | Utility types and methods typically used by generic libraries. |Common used structs and classes.
| Type | | Description
| --------------------------------------------- | --------- | -----------------------------
| [EntityStore](api/EntityStore.md) | class | Container of entities. Typically called `World` in other implementations.
| [Entity](api/Entity.md) | struct | An object in an EntityStore. Contains components, tags, scripts and child entities.
| | |
| [IComponent](api/IComponent.md) | interface | Attribute structs as component types.
| [ITag](api/ITag.md) | interface | Attribute structs as tags.
| [Script](api/Script.md) | class | Base class of scripts that can be added to entities.
| | |
| [ArchetypeQuery](api/ArchetypeQuery.md) | class | Used to return components and entities matching the assigned query filter.
| [QueryJob](api/QueryJob.md) | class | Enables parallel query execution.
| [ParallelJobRunner](api/ParallelJobRunner.md) | class | Required for parallel (multi threaded) query execution.
| [CommandBuffer](api/CommandBuffer.md) | class | Record entity changes on arbitrary threads and Playback() them on the main thread.
| | |
| [EventFilter](api/EventFilter.md) | class | Used to filter structural changes made to entities like added/removed components/tags.
| [EventRecorder](api/EventRecorder.md) | class | Record entity changes like adding/removing commands/tags. Required for EventFilter's.
| | |
| [EntityBatch](api/EntityBatch.md) | class | Used to optimize adding/removing components/tags to entities via a fluent API.
| [CreateEntityBatch](api/CreateEntityBatch.md) | class | Used to optimize entity creation via a fluent API.
| | |
| [EntitySerializer](api/EntitySerializer.md) | class | Enables serialization of entities to / from JSON.## Hello World
The hello world examples demonstrates the creation of some entities
and their movement using a simple `ForEachEntity()` call.Much more examples at [Friflo.Engine.ECS · Examples](https://github.com/friflo/Friflo.Engine.ECS#-examples)
```csharp
public struct Velocity : IComponent { public Vector3 value; }public static void HelloWorld()
{
var store = new EntityStore();
for (int n = 0; n < 10; n++) {
store.CreateEntity(new Position(n, 0, 0), new Velocity{ value = new Vector3(0, n, 0)});
}
var query = store.Query();
query.ForEachEntity((ref Position position, ref Velocity velocity, Entity entity) => {
position.value += velocity.value;
});
}
```Interactive Browser Demo showing MonoGame WebAssembly integration. [Try out Demo](https://sdl-wasm-sample-web.vercel.app/docs/MonoGame/).
*Note:* WebGL rendering performance cannot compete with Desktop build.