materials 
Vars | |
| base_stack_recipes | List of stackcrafting recipes for materials using base recipes |
|---|---|
| dimensional_themes | A list of dimensional themes used by the dimensional anomaly and other things, most of which require materials to function. |
| flat_materials | Flat list of materials |
| material_combos | A cache of all material combinations that have been used |
| materials | Dictionary of material.id || material ref |
| materials_by_type | Dictionary of type || list of material refs |
| properties | An ID -> instance list of material properties |
| requirements | A typepath -> instance list of material requirements |
| rigid_stack_recipes | List of stackcrafting recipes for materials using rigid recipes |
Procs | |
| get_id_from_args | I'm not going to lie, this was swiped from SSdcs. Credit does to ninjanomnom |
| get_material | Fetches a cached material singleton when passed sufficient arguments. Arguments: |
| get_material_set_cache | Returns a list to be used as an object's custom_materials. Lists will be cached and re-used based on the parameters. |
| get_materials_by_flag | Fetches all materials that match a flag, or that don't have a flag if the passed flag is negative |
| get_materials_by_req | Returns all materials that fit a requirement datum |
| initialize_material | |
| initialize_materials | Ran on initialize, populated the materials and material dictionaries with their appropriate vars (See these variables for more info) |
Var Details
base_stack_recipes 
List of stackcrafting recipes for materials using base recipes
dimensional_themes 
A list of dimensional themes used by the dimensional anomaly and other things, most of which require materials to function.
flat_materials 
Flat list of materials
material_combos 
A cache of all material combinations that have been used
materials 
Dictionary of material.id || material ref
materials_by_type 
Dictionary of type || list of material refs
properties 
An ID -> instance list of material properties
requirements 
A typepath -> instance list of material requirements
rigid_stack_recipes 
List of stackcrafting recipes for materials using rigid recipes
Proc Details
get_id_from_args
I'm not going to lie, this was swiped from SSdcs. Credit does to ninjanomnom
Generates an id for bespoke elements materials when given the argument list
Generating the id here is a bit complex because we need to support named arguments
Named arguments can appear in any order and we need them to appear after ordered arguments
We assume that no one will pass in a named argument with a value of null
get_material
Fetches a cached material singleton when passed sufficient arguments. Arguments:
- The first argument is a material datum, text string, or material type.
- Material datums are assumed to be references to the cached datum and are returned
- Text is assumed to be the text ID of a material and the corresponding material is fetched from the cache
- A material type is checked for bespokeness:
- If the material type is not bespoke the type is assumed to be the id for a material and the corresponding material is loaded from the cache.
- If the material type is bespoke a text ID is generated from the arguments list and used to load a material datum from the cache.
- The following elements are used to generate bespoke IDs
get_material_set_cache
Returns a list to be used as an object's custom_materials. Lists will be cached and re-used based on the parameters.
get_materials_by_flag
Fetches all materials that match a flag, or that don't have a flag if the passed flag is negative
get_materials_by_req
Returns all materials that fit a requirement datum
initialize_material
- Creates and caches a material datum.
- The first argument is the type of material to initialize, the rest are passed to the material's init
initialize_materials
Ran on initialize, populated the materials and material dictionaries with their appropriate vars (See these variables for more info)