gas_mixture

Vars | |
analyzer_results | Used for analyzer feedback - not initialized until its used |
---|---|
gc_share | Whether to call garbage_collect() on the sharer during shares, used for immutable mixtures |
reaction_results | The fire key contains information that might determine the volume of hotspots. |
Procs | |
add_gas | add_gas(gas_id) - similar to assert_gas(), but does not check for an existing gas list for this id. This can clobber existing gases. Used instead of assert_gas() when you know the gas does not exist. Faster than assert_gas(). |
add_gases | add_gases(args) - shorthand for calling add_gas() once for each gas_type. |
archive | Update archived versions of variables. Returns: 1 in all cases |
assert_gas | assert_gas(gas_id) - used to guarantee that the gas list for this id exists in gas_mixture.gases. Must be used before adding to a gas. May be used before reading from a gas. |
assert_gases | assert_gases(args) - shorthand for calling ASSERT_GAS() once for each gas type. |
compare | Compares sample to self to see if within acceptable ranges that group processing may be enabled Returns: a string indicating what check failed, or "" if check passes |
copy | Creates new, identical gas mixture Returns: duplicate gas mixture |
copy_from | Copies variables from sample, moles multiplicated by partial Returns: 1 if we are mutable, 0 otherwise |
copy_from_turf | Copies all gas info from the turf into the gas list along with temperature Returns: TRUE if we are mutable, FALSE otherwise |
equalize | Distributes the contents of two mixes equally between themselves |
garbage_collect | garbage_collect() - removes any gas list which is empty. If called with a list as an argument, only removes gas lists with IDs from that list. Must be used after subtracting from a gas. Must be used after assert_gas() if assert_gas() was called only to read from the gas. By removing empty gases, processing speed is increased. |
get_breath_partial_pressure | Takes the amount of the gas you want to PP as an argument So I don't have to do some hacky switches/defines/magic strings eg: Tox_PP = get_partial_pressure(gas_mixture.toxins) O2_PP = get_partial_pressure(gas_mixture.oxygen) |
get_true_breath_pressure | inverse |
has_gas | Checks to see if gas amount exists in mixture. Do NOT use this in code where performance matters! It's better to batch calls to garbage_collect(), especially in places where you're checking many gastypes |
heat_capacity | joules per kelvin |
merge | Merges all air from giver into self. Deletes giver. Returns: 1 if we are mutable, 0 otherwise |
parse_gas_string | Copies variables from a particularly formatted string. Returns: 1 if we are mutable, 0 otherwise |
pump_gas_to | Mathematical proofs: get_breath_partial_pressure(gas_pp) --> gas_pp/total_moles()breath_pp = pp get_true_breath_pressure(pp) --> gas_pp = pp/breath_pptotal_moles() |
react | Performs various reactions such as combustion and fabrication Returns: 1 if any reaction took place; 0 otherwise |
release_gas_to | Releases gas from src to output air. This means that it can not transfer air to gas mixture with higher pressure. |
remove | Proportionally removes amount of gas from the gas_mixture. Returns: gas_mixture with the gases removed |
remove_ratio | Proportionally removes amount of gas from the gas_mixture. Returns: gas_mixture with the gases removed |
remove_specific | Removes an amount of a specific gas from the gas_mixture. Returns: gas_mixture with the gas removed |
return_pressure | Calculate pressure in kilopascals |
return_temperature | Calculate temperature in kelvins |
return_visuals | Gets the gas visuals for everything in this mixture |
return_volume | Calculate volume in liters |
share | Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length Returns: amount of gas exchanged (+ if sharer received) |
temperature_share | Performs temperature sharing calculations (via conduction) between two gas_mixtures assuming only 1 boundary length Returns: new temperature of the sharer |
thermal_energy | Calculate thermal energy in joules |
total_moles | Calculate moles |
Var Details
analyzer_results

Used for analyzer feedback - not initialized until its used
gc_share

Whether to call garbage_collect() on the sharer during shares, used for immutable mixtures
reaction_results

The fire key contains information that might determine the volume of hotspots.
Proc Details
add_gas
add_gas(gas_id) - similar to assert_gas(), but does not check for an existing gas list for this id. This can clobber existing gases. Used instead of assert_gas() when you know the gas does not exist. Faster than assert_gas().
add_gases
add_gases(args) - shorthand for calling add_gas() once for each gas_type.
archive
Update archived versions of variables. Returns: 1 in all cases
assert_gas
assert_gas(gas_id) - used to guarantee that the gas list for this id exists in gas_mixture.gases. Must be used before adding to a gas. May be used before reading from a gas.
assert_gases
assert_gases(args) - shorthand for calling ASSERT_GAS() once for each gas type.
compare
Compares sample to self to see if within acceptable ranges that group processing may be enabled Returns: a string indicating what check failed, or "" if check passes
copy
Creates new, identical gas mixture Returns: duplicate gas mixture
copy_from
Copies variables from sample, moles multiplicated by partial Returns: 1 if we are mutable, 0 otherwise
copy_from_turf
Copies all gas info from the turf into the gas list along with temperature Returns: TRUE if we are mutable, FALSE otherwise
equalize
Distributes the contents of two mixes equally between themselves
garbage_collect
garbage_collect() - removes any gas list which is empty. If called with a list as an argument, only removes gas lists with IDs from that list. Must be used after subtracting from a gas. Must be used after assert_gas() if assert_gas() was called only to read from the gas. By removing empty gases, processing speed is increased.
get_breath_partial_pressure
Takes the amount of the gas you want to PP as an argument So I don't have to do some hacky switches/defines/magic strings eg: Tox_PP = get_partial_pressure(gas_mixture.toxins) O2_PP = get_partial_pressure(gas_mixture.oxygen)
get_true_breath_pressure
inverse
has_gas
Checks to see if gas amount exists in mixture. Do NOT use this in code where performance matters! It's better to batch calls to garbage_collect(), especially in places where you're checking many gastypes
heat_capacity
joules per kelvin
merge
Merges all air from giver into self. Deletes giver. Returns: 1 if we are mutable, 0 otherwise
parse_gas_string
Copies variables from a particularly formatted string. Returns: 1 if we are mutable, 0 otherwise
pump_gas_to
Mathematical proofs: get_breath_partial_pressure(gas_pp) --> gas_pp/total_moles()breath_pp = pp get_true_breath_pressure(pp) --> gas_pp = pp/breath_pptotal_moles()
10/205 = 2.5 10 = 2.5/520 Pumps gas from src to output_air. Amount depends on target_pressure
react
Performs various reactions such as combustion and fabrication Returns: 1 if any reaction took place; 0 otherwise
release_gas_to
Releases gas from src to output air. This means that it can not transfer air to gas mixture with higher pressure.
remove
Proportionally removes amount of gas from the gas_mixture. Returns: gas_mixture with the gases removed
remove_ratio
Proportionally removes amount of gas from the gas_mixture. Returns: gas_mixture with the gases removed
remove_specific
Removes an amount of a specific gas from the gas_mixture. Returns: gas_mixture with the gas removed
return_pressure
Calculate pressure in kilopascals
return_temperature
Calculate temperature in kelvins
return_visuals
Gets the gas visuals for everything in this mixture
return_volume
Calculate volume in liters
share
Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length Returns: amount of gas exchanged (+ if sharer received)
temperature_share
Performs temperature sharing calculations (via conduction) between two gas_mixtures assuming only 1 boundary length Returns: new temperature of the sharer
thermal_energy
Calculate thermal energy in joules
total_moles
Calculate moles