lib/inventory.js
function isWearable (attributes, index) {
        if (index >= attributes.inventory.length) {
            throw new InventoryIndexError(index);
        }

        var item = attributes.inventory[index];

        if (!requirements.met(attributes, item.requirements)) {
            throw new RequirementsNotMetError();
        }

        var slotName = item.slot;

        if (!slotName) {
            throw new UnequippableItemError(item.name);
        }

        return slotName;
    }
function isWearable (attributes, index) {
        if (index >= attributes.inventory.length) {
            throw new InventoryIndexError(index);
        }

        var item = attributes.inventory[index];

        if (!requirements.met(attributes, item.requirements)) {
            throw new RequirementsNotMetError();
        }

        var slotName = item.slot;

        if (!slotName) {
            throw new UnequippableItemError(item.name);
        }

        return slotName;
    }
function isWearable ( attributes , index ) { if ( index >= attributes . inventory . length ) { throw new InventoryIndexError ( index ) ; } var item = attributes . inventory [ index ] ; if ( ! requirements . met ( attributes , item . requirements ) ) { throw new RequirementsNotMetError ( ) ; } var slotName = item . slot ; if ( ! slotName ) { throw new UnequippableItemError ( item . name ) ; } return slotName ; }
Given index of item, returns list of possible slots
@param {Attributes} attributes
@param {number} index
@return {String}
Given index of item returns list of possible slots