Often my systems will expect certain fields to exist within components.
It'd be great to have a built-in way to support default values for components when they're assigned to entities.
I'm thinking it could work something like:
local component = Matter.component(name, { foo = "bar", xyz = nil })
world:spawn(component({ xyz = "abc" })) -- an entity is created with component data as { foo = "bar", xyz = "abc" }
Often my systems will expect certain fields to exist within components.
It'd be great to have a built-in way to support default values for components when they're assigned to entities.
I'm thinking it could work something like: