// selectIOV.js
(function () {
/*global adventurejs A*/
var p = adventurejs.Parser.prototype;
/**
* Exclude from a list of assets all assets that are not direct objects of verb.
* @method adventurejs.Parser#selectIOV
* @memberOf adventurejs.Parser
* @param {Array} list
* @returns {Array}
*/
p.selectIOV = function Parser_selectIOV(list, verb) {
if (typeof list !== "object") {
console.warn("selectIOV received non-array", list);
return [];
}
var foundObjects = [];
for (var i = 0; i < list.length; i++) {
console.log("selectIOV list[i]", list[i]);
var object = this.game.getAsset(list[i]);
if (object.isIOV(verb)) {
foundObjects.push(list[i]);
}
}
return foundObjects;
};
})();