|
|
|
|
|
by jayd16
1647 days ago
|
|
In some ways ECS could be considered stateless, as the entity holds the game state as raw data, while the system operates on that data without holding a state of its own. How would you implement ECS, a system for tracking the state of game entities, in a stateless manner? Can you expand on that? |
|
Stateful way: your Inventory Manager component iterates through its private array of item entities to mark their model components as shown or hidden, then calls the dependency injected character's avatar component to update its animation state.
Stateless way: you flip an integer in character's struct, and the rendering function does something different.