mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
27 lines
768 B
JavaScript
27 lines
768 B
JavaScript
/** @module ActionCollection */
|
|
kit.PluginManager.register('ActionCollection', function(module, exports, require, global) {
|
|
|
|
var Collection = require('Collection');
|
|
|
|
/**
|
|
* @memberOf kit
|
|
*/
|
|
var ActionCollection = function (list = []) {
|
|
this.collection = new Collection(list);
|
|
};
|
|
ActionCollection.prototype.push = function (action) {
|
|
this.collection.push(action);
|
|
};
|
|
ActionCollection.prototype.run = function (count = -1) {
|
|
this.collection.map(function (action) {
|
|
action.run(count);
|
|
})
|
|
};
|
|
ActionCollection.prototype.stop = function () {
|
|
this.collection.map(function (action) {
|
|
action.stop();
|
|
})
|
|
};
|
|
|
|
return module.exports = ActionCollection;
|
|
}); |