material_container
Vars | |
after_insert | A callback invoked after materials are inserted into this container |
---|---|
allowed_item_typecache | The typecache of things that this material container can accept |
allowed_materials | The list of materials that this material container can accept |
insertion_check | A callback for checking wheter we can insert a material into this container |
last_inserted_id | The last main material that was inserted into this container |
mat_container_flags | The material container flags. See __DEFINES/materials.dm. |
materials | Map of material ref -> amount |
max_amount | The maximum amount of materials this material container can contain |
precise_insertion | Whether or not this material container allows specific amounts from sheets to be inserted |
precondition | A callback invoked before materials are inserted into this container |
total_amount | The total amount of materials this material container contains |
Procs | |
Initialize | Sets up the proper signals and fills the list of materials with the appropriate references. |
amount2sheet | Turns a material amount into the amount of sheets it should output |
can_hold_material | The default check for whether we can add materials to this material container. |
can_insert_amount_mat | Proc for checking if there is room in the component, returning the amount or else the amount lacking. |
get_categories | Returns all the categories in a recipe. |
get_item_material_amount | returns the amount of material relevant to this container; if this container does not support glass, any glass in 'I' will not be taken into account |
get_material_amount | Returns the amount of a specific material in this container. |
has_enough_of_category | Returns TRUE if you have enough of a specified material category (Which could be multiple materials) |
has_enough_of_material | Returns TRUE if you have enough of the specified material. |
has_materials | Checks if its possible to afford a certain amount of materials. Takes a dictionary of materials. |
has_space | Proc that returns TRUE if the container has space |
insert_amount_mat | For inserting an amount of material |
insert_item | Proc specifically for inserting items, returns the amount of materials entered. |
insert_item_materials | Inserts the relevant materials from an item into this material container. |
on_attackby | Proc that allows players to fill the parent with mats |
retrieve_all | Proc to get all the materials and dump them as sheets |
retrieve_sheets | For spawning mineral sheets at a specific location. Used by machines to output sheets. |
sheet2amount | Turns an amount of sheets into the amount of material amount it should output |
transer_amt_to | Proc for transfering materials to another container. |
ui_data | List format is list(material_name = list(amount = ..., ref = ..., etc.)) |
use_amount_mat | Uses an amount of a specific material, effectively removing it. |
use_materials | For consuming a dictionary of materials. mats is the map of materials to use and the corresponding amounts, example: list(M/datum/material/glass =100, datum/material/iron=200) |
user_insert | Proc used for when player inserts materials |
Var Details
after_insert
A callback invoked after materials are inserted into this container
allowed_item_typecache
The typecache of things that this material container can accept
allowed_materials
The list of materials that this material container can accept
insertion_check
A callback for checking wheter we can insert a material into this container
last_inserted_id
The last main material that was inserted into this container
mat_container_flags
The material container flags. See __DEFINES/materials.dm.
materials
Map of material ref -> amount
max_amount
The maximum amount of materials this material container can contain
precise_insertion
Whether or not this material container allows specific amounts from sheets to be inserted
precondition
A callback invoked before materials are inserted into this container
total_amount
The total amount of materials this material container contains
Proc Details
Initialize
Sets up the proper signals and fills the list of materials with the appropriate references.
amount2sheet
Turns a material amount into the amount of sheets it should output
can_hold_material
The default check for whether we can add materials to this material container.
Arguments:
- mat: The material we are checking for insertability.
can_insert_amount_mat
Proc for checking if there is room in the component, returning the amount or else the amount lacking.
get_categories
Returns all the categories in a recipe.
get_item_material_amount
returns the amount of material relevant to this container; if this container does not support glass, any glass in 'I' will not be taken into account
get_material_amount
Returns the amount of a specific material in this container.
has_enough_of_category
Returns TRUE if you have enough of a specified material category (Which could be multiple materials)
has_enough_of_material
Returns TRUE if you have enough of the specified material.
has_materials
Checks if its possible to afford a certain amount of materials. Takes a dictionary of materials.
has_space
Proc that returns TRUE if the container has space
insert_amount_mat
For inserting an amount of material
insert_item
Proc specifically for inserting items, returns the amount of materials entered.
insert_item_materials
Inserts the relevant materials from an item into this material container.
Arguments:
- source: The source of the materials we are inserting.
- multiplier: The multiplier for the materials being inserted.
- breakdown_flags: The breakdown bitflags that will be used to retrieve the materials from the source
on_attackby
Proc that allows players to fill the parent with mats
retrieve_all
Proc to get all the materials and dump them as sheets
retrieve_sheets
For spawning mineral sheets at a specific location. Used by machines to output sheets.
sheet2amount
Turns an amount of sheets into the amount of material amount it should output
transer_amt_to
Proc for transfering materials to another container.
ui_data
List format is list(material_name = list(amount = ..., ref = ..., etc.))
use_amount_mat
Uses an amount of a specific material, effectively removing it.
use_materials
For consuming a dictionary of materials. mats is the map of materials to use and the corresponding amounts, example: list(M/datum/material/glass =100, datum/material/iron=200)
user_insert
Proc used for when player inserts materials