saltysystems / overworld

Open source framework for scalable multiplayer games.
Mozilla Public License 2.0
20 stars 3 forks source link

ECS API simplification #12

Closed cmdrk closed 1 year ago

cmdrk commented 1 year ago

This set of changes changes the API to only require the world name when calling ECS functions.

E.g.,

fun(World) ->
  Query = ow_ecs:query(World),
  Component = ow_ecs:match_component(some_component, Query),
  % do something...

you now simply

fun(World) -> 
  Component = ow_ecs:match_component(some_component, World)
  % do something...

Also changes entity/2 to simply return the components within.