NSSTC / sim-ecs

Batteries included TypeScript ECS
https://nsstc.github.io/sim-ecs/
Mozilla Public License 2.0
81 stars 12 forks source link

Create shorthand aliases for long `with...()` methods #53

Closed minecrawler closed 1 year ago

minecrawler commented 2 years ago

There are a lot of methods which start with with and end up having long names. Especially when creating e.g. many systems, having such long names becomes a burden, so there should be short aliases available:

ISystemBuilder

Original name Alias
withName name
withRunFunction run
withSetupFunction setup

IWorldBuilder

Original name Alias
withComponent c
withComponent component
withComponents components
withDefaultScheduler don't change it for clarity
withName name
withDefaultScheduling don't change it for clarity
withStateScheduler don't change it for clarity
withStateScheduling don't change it for clarity

There are with() and withAll() methods, too, but it does not make sense to further shorten them imo...