UNPKG

woltlab-compiler

Version:

A compiler for WoltLab-Package Archives and WoltLab-Package Components

46 lines 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Node_1 = require("../../../NodeSystem/Node"); const Instruction_1 = require("../Instruction"); /** * Represents an instruction which provides nodes. */ class NodeSystemInstruction extends Instruction_1.Instruction { /** * Initializes a new instance of the `NodeSystemInstruction<T>` class. * * @param options * The options for generating the object. * * @param generator * The generator-function for generating sub-nodes. */ constructor(options, generator) { super(options); /** * The nodes provides by the instruction. */ this.nodes = []; for (let node of options.Nodes) { this.nodes.push(new Node_1.Node(node, generator)); } } /** * @inheritdoc */ get Nodes() { return this.nodes; } /** * @inheritdoc */ get ObjectsByID() { let result = {}; for (let node of this.Nodes) { Object.assign(result, node.GetObjects()); } return result; } } exports.NodeSystemInstruction = NodeSystemInstruction; //# sourceMappingURL=NodeSystemInstruction.js.map