var Class = require('../utils/Class'); var LinkFile = new Class({ initialize: function LinkFile(loader, type, key, files){ this.loader = loader; this.type = type; this.key = key; this.files = files; this.complete = false ; this.pending = _AN_Read_length('length', files); this.failed = 0; for (var i = 0; i < (_AN_Read_length('length', files)); i++ ){ files[i].linkFile = this; } } , onFileComplete: function (file){ var index = this.files.indexOf(file); if (index !== -1) { this.pending-- ; } } , onFileFailed: function (file){ var index = this.files.indexOf(file); if (index !== -1) { this.failed++ ; } } } ); module.exports = LinkFile;