Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// DOVisConnectedToNothing.js
(function() {
	/*global adventurejs A*/ 
  "use strict";
  var p = adventurejs.Asset.prototype;	
  /**
   * Check whether this asset is currently connected as an indirect
   * object to nothing 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 
   * store a null value to 
   * <code class="property">asset.dov.plugIn.with_params.connections</code>
   * to represent the computer's plugged in state.
   * @memberOf adventurejs.Asset
	 * @method adventurejs.Asset#DOVisConnectedToNothing
   * @param {String} verb The name of a verb.
   * @return {Boolean}
   */
  p.DOVisConnectedToNothing = function Asset_DOVisConnectedToNothing(verb)
  { 
    if( !verb || !this.game.dictionary.verbs[verb] ) return false;
    if( !this.dov[verb]?.with_params.connections
      || -1 === this.dov[verb].with_params.connections.indexOf(null) )
      {
        return false;
      }
    return true;
  }
}());