38 auto arch = item->
arch;
90 if (arch.second->clone.name == tmp) {
102 if (arch.second->clone.type == type && strcmp(arch.second->clone.name, name) == 0)
114 if (((type == -1) || (type == arch.second->clone.type))
115 && (arch.second->clone.skill) && (!strcmp(arch.second->clone.skill, skill)))
123 if (((type == -1) || (type == arch.second->clone.type))
124 && (subtype == -1 || subtype == arch.second->clone.subtype))
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...
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
struct archetype * arch
Pointer to archetype.
archetype * findBySkillNameAndType(const char *skill, int type)
Retrieve an archetype by skill name and type.
void asset_destroy(archetype *item)
object * below
Pointer to the object stacked below this one.
sstring add_string(const char *str)
Share a string.
archetype * findByObjectName(const char *name)
Retrieve an archetype given the name that appears during the game (for example, "writing pen" instead...
sstring find_string(const char *str)
Searches a string in the shared strings.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
std::unordered_map< std::string, archetype *> m_assets
Known assets.
#define FLAG_REMOVED
Object is not in any map or invenory.
virtual void replace(archetype *existing, archetype *update) override
Replace an asset by an updated version.
int set_variable(object *op, const char *buf)
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.
sstring name
More definite name, like "generate_kobold".
void object_free_inventory(object *ob)
Frees the inventory of an object, without any callback.
static void mark_inv_not_removed(object *item)
Recursively mark all items in inventory as not removed.
archetype * asset_create(const std::string &name)
void object_copy_with_inv(const object *src_ob, object *dest_ob, bool update_speed)
Copy an object with an inventory, duplicate the inv too.
archetype * get_archetype_struct(void)
Allocates, initialises and returns the pointer to an archetype structure.
#define CLEAR_FLAG(xyz, p)
void get_ob_diff(StringBuffer *sb, const object *op, const object *op2)
Returns a pointer to a static string which contains all variables which are different in the two give...
object * inv
Pointer to the first object in the inventory.
void free_arch(archetype *at)
Frees archetype.
archetype * findByTypeSubtype(int type, int subtype)
Retrieve an archetype by type and subtype.
object clone
An object from which to do object_copy()