(...commandClasses)
| 1563 | this.#commands[keyword] = definition; |
| 1564 | } |
| 1565 | addCommands(...commandClasses) { |
| 1566 | for (const CommandClass of commandClasses) { |
| 1567 | if (!CommandClass.keyword) { |
| 1568 | throw new Error(`Command class ${CommandClass.name} must have a static 'keyword' property`); |
| 1569 | } |
| 1570 | if (!CommandClass.parse) { |
| 1571 | throw new Error(`Command class ${CommandClass.name} must have a static 'parse' method`); |
| 1572 | } |
| 1573 | var keywords = Array.isArray(CommandClass.keyword) ? CommandClass.keyword : [CommandClass.keyword]; |
| 1574 | for (var kw of keywords) this.addCommand(kw, CommandClass.parse); |
| 1575 | } |
| 1576 | } |
| 1577 | addFeatures(...featureClasses) { |
| 1578 | for (const FeatureClass of featureClasses) { |
| 1579 | if (!FeatureClass.keyword) { |
nothing calls this directly
no test coverage detected