Entity: The entity is a general purpose object. It only consists of a unique id. They "tag every coarse gameobject as a separate item". Example:
Entity.create id world
|> Entity.with ( positionSpec, positionComponent )
|> Entity.with ( velocitySpec, velocityComponent )Start point for spawning Entity
Entity.create id world
|> Entity.with ( positionSpec, positionComponent )
|> Entity.with ( velocitySpec, velocityComponent )Set component to spawn with new entity
Entity.create ( id, world )
|> Entity.with ( positionSpec, positionComponent )
|> Entity.with ( velocitySpec, velocityComponent )Way to create Entity destruction functions, should pipe in all possible component specs.
Also can be used to just disable (remove) some components from entity.
remove =
Entity.remove positionSpec
>> Entity.remove velocitySpec
newWorld =
remove ( id, world )