static void recursive_update(object *item, archetype *updated)
Update if needed item based on the updated archetype, then recurse on item->below and item->inv...
void clearReplaceListener()
Remvove the listener for archetypes changes.
archetype * findBySkillNameAndType(const char *skill, int type)
Retrieve an archetype by skill name and type.
archetype * findByObjectName(const char *name)
Retrieve an archetype given the name that appears during the game (for example, "writing pen" instead...
std::function< void(archetype *, archetype *)> updateListener
Function prototype to be called when an archetype changes.
All archetypes in the game.
Collection of assets identified by a unique name.
Archetypes()
Standard constructor.
Global type definitions and header inclusions.
void setReplaceListener(updateListener fct)
Set the listener to be called when an archetype is updated.
virtual void replace(archetype *existing, archetype *update) override
Replace an asset by an updated version.
updateListener m_updateListener
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
archetype * findByObjectTypeName(int type, const char *name)
Retrieve an archetype by type and name that appears during the game.
archetype * empty_archetype
Nice to have fast access to it.
archetype * findByTypeSubtype(int type, int subtype)
Retrieve an archetype by type and subtype.