> For the complete documentation index, see [llms.txt](https://ecsrx.gitbook.io/systemsrx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ecsrx.gitbook.io/systemsrx/the-framework/systems.md).

# Systems

Systems are where all the logic lives.

The way systems are designed there is an orchestration layer which wraps all systems and handles the communication between the pools and the execution/reaction/setup methods known as `ISystemExecutor` (Which can be read about on other pages).

You just express how you want to trigger your systems and let the `SystemExecutor` handle the heavy lifting and trigger the relevant method in the system when its time. This can easily be seen when you look at all the available system interfaces which all process individual entities not groups of them.

> This only documents the SystemsRx available systems but EcsRx builds on top of this and provides many other system types and an ECS paradigm.

## System Types

This is where it gets interesting, so we have multiple flavours of systems depending on how you want to trigger them, by default there is `IManualSystem` which acts as a simple setup/teardown style system. You can also mix them up so you could have a single system implement `IManualSystem`, `IBasicSystem` and `IReactToEventSystem` which would trigger all the required methods when system sets up/tears down, when an update happens and when an event comes in, but ultimately you can mix and match the interfaces however you want.

### `IManualSystem`

This is a niche system for when you want to carry out some logic outside the scope of entities, or want to have more fine grained control over how you deal with the entities matched.

Rather than the `SystemExecutor` doing most of the work for you and managing the subscriptions it leaves it up to you to manage everything how you want once the system has been started.

The `StartSystem` method will be triggered when the system has been added to the executor, and the `StopSystem` will be triggered when the system is removed.

### `IBasicSystem`

This is a basic system that is triggered every update (based on scheduler update frequency) and lets you do anything you want per update.

### `IReactToEventSystem`

This allows you to react to any event of that type which is published over the `IEventSystem`.

## System Loading Order

So by default (with the default implementation of `ISystemExecutor`) systems will load in the order you add them, however you can add a `[Priority]` attribute to indicate an explicit order for running.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://ecsrx.gitbook.io/systemsrx/the-framework/systems.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
