Class: SubstanceMixer
Class: SubstanceMixer
Extends: adventurejs.Atom
Defined in: adventure/SubstanceMixer.js, line 6
Todos: Solid+liquid->slurry.
Public Constructor:
var mixer = new adventurejs.SubstanceMixer( this.game.game_name )
SubstanceMixer is a special internal class that is instantiated whenever Substances are mixed together from two (or in theory, more) sources. For instance, if player pours a glass full of liquid into a bowl that also contains liquid, we make a new SubstanceMixer to handle the interaction. This is true even if both Vessels contain the same Substance. SubstanceMixer handles:
- temperature conversion, if SubstancesContainers are at different temperatures
- volume operations - comparing available volume in source and destination, removing part or all from source as needed
- mixwith handling, if two Substances are set to mix with each other to form a third Substance
- overflow of the target container if needed
Example:
Private Constructor:
var foo = new adventurejs.SubstanceMixer(game_name)
Parameters:
-
game_name
String
Name of top level game instance that is scoped to window.
- Index
- Methods
- Properties
Index
Methods:
- Inherited from Atom getInheritance
- Inherited from Atom hasClass
- mix
- Inherited from Atom Overrides from Atom set
Properties:
- can_drain_target
- can_overflow_target
- did_displace_substance
- did_fill_target
- did_mix_substances
- did_overflow_target
- Inherited from Atom game
- Inherited from Atom Name
- output_substance_asset
- output_substance_id
- source_aspect
- source_asset
- source_input
- source_split
- source_substance_asset
- source_substance_id
- source_vessel
- source_volume
- source_volume_used
- target_already_full
- target_aspect
- target_asset
- target_freevolume
- target_input
- target_split
- target_substance_asset
- target_substance_id
- target_vessel
- target_volume
Methods Collapse all |
getInheritance() → {Array}
Defined in: adventure/Atom.js, line 151
Inherited from: adventurejs.Atom#getInheritance
Returns:
Array
hasClass(prop) → {Boolean}
Defined in: adventure/Atom.js, line 131
Inherited from: adventurejs.Atom#hasClass
Parameters:
-
prop
String
Name of the class to test for.
Returns:
Boolean
mix() → {boolean}
Defined in: adventure/SubstanceMixer.js, line 260
Returns:
boolean
set(props) → {Object}
Defined in: adventure/Atom.js, line 119
Overrides from: adventurejs.Atom#set
Parameters:
-
props
Object
A generic object containing properties to copy to the Object instance.
Returns:
Object
Returns the instance the method is called on (useful for chaining calls.)
Properties |
can_drain_target :Boolean
Defined in: adventure/SubstanceMixer.js, line 232
Default value: false
can_overflow_target :Boolean
Defined in: adventure/SubstanceMixer.js, line 249
Default value: false
did_displace_substance :Boolean
Defined in: adventure/SubstanceMixer.js, line 223
Default value: false
did_fill_target :Boolean
Defined in: adventure/SubstanceMixer.js, line 208
Default value: false
did_mix_substances :Boolean
did_overflow_target :Boolean
Defined in: adventure/SubstanceMixer.js, line 240
Default value: false
game :Getter
Defined in: adventure/Atom.js, line 110
Inherited from: adventurejs.Atom#game
this.game
.
Name :String
Defined in: adventure/Atom.js, line 97
Inherited from: adventurejs.Atom#Name
output_substance_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 184
Default value: null
output_substance_id :String
Defined in: adventure/SubstanceMixer.js, line 192
Default value: ""
source_aspect :String
Defined in: adventure/SubstanceMixer.js, line 66
Default value: ""
source_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 59
Default value: null
source_input :String
Defined in: adventure/SubstanceMixer.js, line 50
Default value: ""
source_split :Array|String|null
Defined in: adventure/SubstanceMixer.js, line 95
Default value: null
source_substance_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 81
Default value: null
source_substance_id :String
Defined in: adventure/SubstanceMixer.js, line 88
Default value: ""
source_vessel :Object|null
Defined in: adventure/SubstanceMixer.js, line 74
Default value: null
source_volume :int
Defined in: adventure/SubstanceMixer.js, line 102
Default value: 0
source_volume_used :int
Defined in: adventure/SubstanceMixer.js, line 109
Default value: 0
target_already_full :Boolean
Defined in: adventure/SubstanceMixer.js, line 200
Default value: false
target_aspect :String
Defined in: adventure/SubstanceMixer.js, line 132
Default value: ""
target_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 125
Default value: null
target_freevolume :float
Defined in: adventure/SubstanceMixer.js, line 177
Default value: 0.0
target_input :String
Defined in: adventure/SubstanceMixer.js, line 116
Default value: ""
target_split :Array|String|null
Defined in: adventure/SubstanceMixer.js, line 163
Default value: null
target_substance_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 147
Default value: null
target_substance_id :String
Defined in: adventure/SubstanceMixer.js, line 155
Default value: ""
target_vessel :Object|null
Defined in: adventure/SubstanceMixer.js, line 140
Default value: null
target_volume :float
Defined in: adventure/SubstanceMixer.js, line 170
Default value: 0.0