Start point for spawning entity
Entity.create ( id, world )
|> Entity.with ( positionSpec, positionComponent )
|> Entity.with ( velocitySpec, velocityComponent )Setting components to spawn with new entity
Entity.create ( id, world )
|> Entity.with ( positionSpec, positionComponent )
|> Entity.with ( velocitySpec, velocityComponent )Remove component from Component.Set by EntityID return new Component.Set, or return unchanged if component not in set
Way to create Entity destruction functions, should pipe in all possible component sets, from what Entity should be removed.
Also can be used to just disable (remove) some components from entity
remove =
Entity.removeFor positionSpec
>> Entity.removeFor velocitySpec
newWorld =
remove ( id, world )Set the component at a particular index. Returns an updated component Set. If the index is out of range, the Set is unaltered.
Safe way to create component, same as setComponent, only if index is out of range Component.Set will be stretched\