// selectNotSubstance.js
(function() {
/*global adventurejs A*/
"use strict";
var p = adventurejs.Parser.prototype;
/**
* Exclude from a list of assets all substance assets.
* @method adventurejs.Parser#selectNotSubstance
* @memberOf adventurejs.Parser
* @param {Array} list
* @returns {Array}
*/
p.selectNotSubstance = function Parser_selectNotSubstance(list)
{
if("string" === typeof list) list = [list];
if( !Array.isArray( list ) )
{
this.game.log( "warn", "critical", "selectNotSubstance.js > received non-array", 'Parser' );
return [];
}
var foundObjects = [];
for(var i = 0; i < list.length; i++)
{
var object = this.game.getAsset( list[i], { prefer_substance: true } );
if( false === object instanceof adventurejs.Substance )
{
foundObjects.push( list[i] );
}
}
return foundObjects;
}
}());