'use strict';

/**
 * Represents a sortie variant
 */
class SortieVariant {
  /**
   * @param   {Object}            data               Sortie variant data
   * @param   {Object}            deps               The dependencies object
   * @param   {MarkdownSettings}  deps.mdConfig      The markdown settings
   * @param   {Translator}        deps.translator    The string translator
   * @param   {Object}            deps.sortieData    The data used to parse sorties
   */
  constructor(data, { mdConfig, translator, sortieData }) {
    /**
     * The markdown settings
     * @type {MarkdownSettings}
     * @private
     */
    this.mdConfig = mdConfig;
    Object.defineProperty(this, 'mdConfig', { enumerable: false, configurable: false });

    /**
     * The variant's boss
     * @type {string}
     */
    this.boss = sortieData.endStates[data.bossIndex].bossName;

    const region = sortieData.endStates[data.bossIndex].regions[data.regionIndex];

    /**
     * The planet where the variant takes place
     * @type {string}
     */
    this.planet = region.name;

    /**
     * The variant's mission type
     * @type {string}
     */
    this.missionType = region.missions[data.missionIndex];

    /**
     * The variant's modifier
     * @type {string}
     */
    this.modifier = sortieData.modifiers[data.modifierIndex];

    /**
     * The node where the variant takes place
     * @type {string}
     */
    this.node = translator.node(data.node);
  }

  /**
   * Returns a string representation of the sortie variant
   * @returns {string}
   */
  toString() {
    return `${this.node} ${this.modifier} ${this.missionType}${this.mdConfig.lineEnd}`;
  }
}

module.exports = SortieVariant;

@@ -6,16 +6,51 @@
 strict';
+%0Aconst rPad = require('right-pad');
 %0A%0A/**%0A *
@@ -1622,16 +1622,21 @@
 turn %60$%7B
+rPad(
 this.nod
@@ -1636,20 +1636,38 @@
 his.node
-%7D $%7B
+, 25, ' ')%7D %7C  $%7BrPad(
 this.mod
@@ -1671,17 +1671,28 @@
 modifier
-%7D
+, 20, '')%7D %7C
  $%7Bthis.

Update SortieVariant.js