Class:SubstanceMixer
Extends: adventurejs.Atom
Defined in: adventure/SubstanceMixer.js, line 5
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 getClassInheritance
- 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 |
getClassInheritance() → {Array}
Defined in: adventure/Atom.js, line 150
Inherited from: adventurejs.Atom#getClassInheritance
Returns:
Array
hasClass(prop) → {Boolean}
Defined in: adventure/Atom.js, line 130
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 259
Returns:
boolean
set(props) → {Object}
Defined in: adventure/Atom.js, line 118
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 231
Default value: false
can_overflow_target :Boolean
Defined in: adventure/SubstanceMixer.js, line 248
Default value: false
did_displace_substance :Boolean
Defined in: adventure/SubstanceMixer.js, line 222
Default value: false
did_fill_target :Boolean
Defined in: adventure/SubstanceMixer.js, line 207
Default value: false
did_mix_substances :Boolean
did_overflow_target :Boolean
Defined in: adventure/SubstanceMixer.js, line 239
Default value: false
game :Getter
Defined in: adventure/Atom.js, line 109
Inherited from: adventurejs.Atom#game
this.game
.
Name :String
Defined in: adventure/Atom.js, line 96
Inherited from: adventurejs.Atom#Name
output_substance_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 183
Default value: null
output_substance_id :String
Defined in: adventure/SubstanceMixer.js, line 191
Default value: ""
source_aspect :String
Defined in: adventure/SubstanceMixer.js, line 65
Default value: ""
source_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 58
Default value: null
source_input :String
Defined in: adventure/SubstanceMixer.js, line 49
Default value: ""
source_split :Array|String|null
Defined in: adventure/SubstanceMixer.js, line 94
Default value: null
source_substance_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 80
Default value: null
source_substance_id :String
Defined in: adventure/SubstanceMixer.js, line 87
Default value: ""
source_vessel :Object|null
Defined in: adventure/SubstanceMixer.js, line 73
Default value: null
source_volume :int
Defined in: adventure/SubstanceMixer.js, line 101
Default value: 0
source_volume_used :int
Defined in: adventure/SubstanceMixer.js, line 108
Default value: 0
target_already_full :Boolean
Defined in: adventure/SubstanceMixer.js, line 199
Default value: false
target_aspect :String
Defined in: adventure/SubstanceMixer.js, line 131
Default value: ""
target_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 124
Default value: null
target_freevolume :float
Defined in: adventure/SubstanceMixer.js, line 176
Default value: 0.0
target_input :String
Defined in: adventure/SubstanceMixer.js, line 115
Default value: ""
target_split :Array|String|null
Defined in: adventure/SubstanceMixer.js, line 162
Default value: null
target_substance_asset :Object|null
Defined in: adventure/SubstanceMixer.js, line 146
Default value: null
target_substance_id :String
Defined in: adventure/SubstanceMixer.js, line 154
Default value: ""
target_vessel :Object|null
Defined in: adventure/SubstanceMixer.js, line 139
Default value: null
target_volume :float
Defined in: adventure/SubstanceMixer.js, line 169
Default value: 0.0