// isConnectedToNothing.js
(function () {
/*global adventurejs A*/
var p = adventurejs.Asset.prototype;
/**
* Check whether this asset is currently connected as an indirect
* object to nothing (aka null) by the specified verb.
* For example, in the case of a computer that can be plugged in, an
* author might prefer not to create a specific outlet into which to
* plug the computer. For that case we allow 'plug in computer', and
* write a null value to
* <code class="property">asset.is.connected_by.plugIn.to_iov</code>
* to represent the computer's plugged in state.
* @memberOf adventurejs.Asset
* @method adventurejs.Asset#isConnectedToNothing
* @param {String} verb The name of a verb.
* @param {String} ov Direct or indirect object of verb.
* @return {Boolean}
*/
p.isConnectedToNothing = function Asset_isConnectedToNothing(verb, ov) {
if (
!verb ||
!this.game.dictionary.verbs[verb] ||
!this.is.connected_by ||
!this.is.connected_by[verb]
)
return false;
if (ov !== "dov" && ov !== "iov") {
if (this.isDOV(verb)) ov = "iov";
else if (this.isIOV(verb)) ov = "dov";
}
if (
this.is.connected_by[verb]["to_" + ov] &&
this.is.connected_by[verb]["to_" + ov].length
) {
return true;
}
return false;
};
})();