Dependencies: lib_2da, lib_2daq, lib_anon, lib_array, lib_bam, lib_fn, lib_ids, lib_ietool, lib_ini, lib_kit, lib_sfo, lib_spl, lib_struct, lib_sugar, lib_tools, lib_vtable
Functions used which are flagged as internal: bam_pad_to_four
class_edit(edit_strrefs_in_place:i, class:s, edits:s, struct:s=k)=() action
Edit the class 'class' (or the list of classes 'class'). 'edits' is executed as an anonymous function, which first reads the class into struct 'struct' (default 'k') and then writes that struct back. ('k' so that the same patch can be used for kits and classes.)
If 'edit_strrefs_in_place' is set to 1, any strrefs have their values updated, rather than being replaced with new strrefs (use this with caution).
(Arguably this is just an internal function: you can put unkitted classes into kit_edit and it just calls class_edit.)
class_read(class:s)=(struct:a) dimorphic
Read a class into a struct. (A wrapper for vtable_read, with a bit of extra stuff to handle editing clabs.)
class_write(edit_strrefs_in_place:b, class:s, struct:s)=() dimorphic
Write the contents of a struct into class 'class'. This includes setting the clab file and the race tables (which are controlled by the 'any_race' and 'human'/'dwarf' (etc) struct variables. If 'edit_strrefs_in_place' is set to 1, any strrefs have their values updated, rather than being replaced with new strrefs (use this with caution).
Note that (unlike for lib_struct functions) 'struct' needs to be an array, not just a set of values. (So intermediate functions need to return the whole array.)