Class: Vessel
Extends: adventurejs.Atom
Defined in: adventure/assets/Vessel.js, line 6
More info: Vessels
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.aspects.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
- Properties
Index
Methods Collapse all |
addVolume(volume)
Defined in: adventure/assets/Vessel.js, line 315
Parameters:
-
volume
number
The volume to add to the vessel.
getInheritance() → {Array}
Defined in: adventure/Atom.js, line 151
Inherited from: adventurejs.Atom#getInheritance
Returns:
Array
getVolume() → {number}
Defined in: adventure/assets/Vessel.js, line 277
Returns:
number
getVolume() → {number}
Defined in: adventure/assets/Vessel.js, line 290
Returns:
number
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
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.)
setVolume(volume)
Defined in: adventure/assets/Vessel.js, line 303
Parameters:
-
volume
number
The volume to set the vessel to.
subtractVolume(volume)
Defined in: adventure/assets/Vessel.js, line 331
Parameters:
-
volume
number
The volume to subtract from the vessel.
Properties |
can_drain :Getter
Defined in: adventure/assets/Vessel.js, line 111
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