// Internal method // Update layer.collideIndexes to either contain or not contain tileIndex var SetLayerCollisionIndex = function (tileIndex, collides, layer) { var loc = layer.collideIndexes.indexOf(tileIndex); if (collides && loc === -1) { layer.collideIndexes.push(tileIndex); } else if (!collides && loc !== -1) { layer.collideIndexes.splice(loc, 1); } }; module.exports = SetLayerCollisionIndex;