zllangct / ecs

A Go-implementation of the ECS (Entity-Component-System), focus on the development of game server.
BSD 3-Clause "New" or "Revised" License
138 stars 9 forks source link

Is there is way to iterate through all entities ? #13

Open cchandel opened 2 years ago

zllangct commented 2 years ago

I don't recommend to iterate all entities, you can manage entities outside ecs like the session in fakegame.

cchandel commented 2 years ago

So, I have a use case where I want to create a log of all that happens in a game.

One way is to log per system. Using a system requires getting data per component and that involves additional calls to figure out the state per entity - since that is really what needs to be logged.

I think it might be cleaner to be able to iterate over the entities and log their states.

Do have another idea ?