ActionsFlow.js
26 lines
| 1 | function ActionsFlow( list = null ) { |
| 2 | /** |
| 3 | * @type {BaseAction[]} |
| 4 | */ |
| 5 | this.list = list; |
| 6 | } |
| 7 | |
| 8 | ActionsFlow.prototype = { |
| 9 | setList( list ) { |
| 10 | this.list = list; |
| 11 | }, |
| 12 | resetID() { |
| 13 | for ( const action of this.list ) { |
| 14 | action.resetID(); |
| 15 | } |
| 16 | }, |
| 17 | /** |
| 18 | * @param type {String} |
| 19 | * @returns {boolean} |
| 20 | */ |
| 21 | hasType( type ) { |
| 22 | return this.list.some( current => current.type === type ); |
| 23 | }, |
| 24 | }; |
| 25 | |
| 26 | export default ActionsFlow; |