⧉ Prototype — clone a configured enemy configure the template once · clone it many times
Template enemythe prototype
👺
Goblin
Sword · 30 HP
Type
Colour
Weapon
HP
30
no clones yet · configuring one enemy = 4 steps
Clones spawned0
Bonus · shallow vs deep copy — the nested inventory trap
🎯 Template inventory
⧉ Cloned enemy inventory
Clone the template, then add an item to the clone — watch whether the template changes too.
Configure once, clone many
Set up the template enemy on the left — type, colour, weapon, HP. Then hit ⧉ Clone: an identical copy appears on the right, all four fields copied in one click. No re-configuring. That's the Prototype pattern.
Each clone copies the template's current values. Change the template, then clone again, and the new copy reflects the change — a clone is a snapshot of the object as it is right now.