namespace
Prefab
A prefab is a model with preset component fields — prefab Grunt: Creature { Stats { hp: 30 }, Weapon { def_id: 1 } } — spawned with spawn Grunt { Position { x: 40 } }, where the spawn's own fields override the presets. Prefabs chain (prefab Grunt: Foe, where Foe is itself a prefab) so shared presets live once. spawn is also an expression yielding the new entity (let e = spawn Grunt { … }), and Prefab.spawn spawns a prefab chosen at runtime by name.