Class: Vessel
Extends: adventurejs.Atom
Defined in: adventure/assets/Vessel.js, line 6
How to: UseSubstanceVessels
Vessel is a special class that
adds the ability to contain substances to
Tangible
Assets.
Vessels must exist within
Aspects,
which exist within
Tangibles.
In other words,
Tangible.Aspect.Vessel
,
or as a practical example: sink.can_put.in.vessel
.
Example:
MyGame.createAsset({
class: "Bowl",
name: "stone bowl",
place: { on: "blood stained shrine" },
descriptions:{look:"It's a stained, chipped stone bowl. ",}
in:
{
vessel: {
maxvolume: 500,
volume: 350,
substance_id: "viscous fluid",
},
},
});
To learn more, see how to Use Substances.
Private Constructor:
var foo = new adventurejs.Vessel(game_name, name)
Parameters:
-
game_name
String
Name of top level game instance that is scoped to window. -
name
String
Instance name.
Index
Methods:
- addVolume
- Inherited from Atom getInheritance
- Inherited from Atom getProperty
- getVolume
- getVolume
- Inherited from Atom hasClass
- Inherited from Atom hasProperty
- Inherited from Atom set
- setVolume
- subtractVolume
Properties:
Methods Collapse all |
Defined in: adventure/assets/Vessel.js, line 442
Parameters:
-
volume
number
The volume to add to the vessel.
Defined in: adventure/Atom.js, line 238
Inherited from: adventurejs.Atom#getInheritance
Returns:
Array
Defined in: adventure/Atom.js, line 184
Inherited from: adventurejs.Atom#getProperty
Parameters:
-
prop
String
Name of the property to test for. Can include dot notation.
if(false === foo.bar.baz)
comparisons.
Returns:
Boolean
Defined in: adventure/assets/Vessel.js, line 394
Returns:
number
Defined in: adventure/assets/Vessel.js, line 411
Returns:
number
Defined in: adventure/Atom.js, line 216
Inherited from: adventurejs.Atom#hasClass
Parameters:
-
prop
String
Name of the classe to test for.
Returns:
Boolean
Defined in: adventure/Atom.js, line 148
Inherited from: adventurejs.Atom#hasProperty
Parameters:
-
prop
String
Name of the property to test for. Can include dot notation.
Returns:
Boolean
Defined in: adventure/Atom.js, line 134
Inherited 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.)
Defined in: adventure/assets/Vessel.js, line 428
Parameters:
-
volume
number
The volume to set the vessel to.
Defined in: adventure/assets/Vessel.js, line 461
Parameters:
-
volume
number
The volume to subtract from the vessel.
Properties Collapse all |
Defined in: adventure/Atom.js, line 74
Inherited from: adventurejs.Atom#class
Defined in: adventure/Atom.js, line 123
Inherited from: adventurejs.Atom#game
this.game
.
Defined in: adventure/Atom.js, line 100
Inherited from: adventurejs.Atom#game_name
Defined in: adventure/Atom.js, line 86
Inherited from: adventurejs.Atom#id
Defined in: adventure/Atom.js, line 54
Inherited from: adventurejs.Atom#name
Defined in: adventure/Atom.js, line 93
Inherited from: adventurejs.Atom#UID