UNPKG

tcx-builder

Version:
45 lines (44 loc) 1.95 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var _common_1 = require("../_common"); var AbstractStep_1 = require("./AbstractStep"); var lodash_1 = require("lodash"); var AbstractStepAttributes_1 = require("./AbstractStepAttributes"); var Step = /** @class */ (function (_super) { __extends(Step, _super); function Step(options) { var _this = this; var attributes = new AbstractStepAttributes_1.AbstractStepAttributes('Step_t'); _this = _super.call(this, attributes, options.stepId) || this; _this.Name = options.name; _this.Duration = options.duration; _this.Intensity = options.intensity; _this.Target = options.target; return _this; } Step.prototype.toXml = function () { var xmlElement = ''; if (!lodash_1.isNil(this.Name)) { xmlElement += _common_1.BaseObject.buildXmlNode('Name', this.Name); } xmlElement += _common_1.BaseObject.buildXmlNode('Duration', this.Duration.toXml(), this.Duration.attributes); xmlElement += _common_1.BaseObject.buildXmlNode('Intensity', this.Intensity); xmlElement += _common_1.BaseObject.buildXmlNode('Target', this.Target.toXml(), this.Target.attributes); return xmlElement; }; return Step; }(AbstractStep_1.AbstractStep)); exports.Step = Step;