<commit_before>function GUIModules(state) {
  var _State = state;

  this.Modules = {};
  this.addGUIModule = function(name) {
    this.Modules[name] = new GUIModule(name);
    return this.Modules[name];
  };

  // TODO(david): Move modules to logical objects
  this.init = function(Stage) {
    // NOTE(david): Turn / day GUI
    // TODO(david): Move to a Turn Tracker object?
    var TurnTracker = this.addGUIModule("TurnTracker");
    var DayEle = TurnTracker.addTextElement("Day", new PIXI.Text("0", { font : "20px monospace", fill: "white"}), _State, "day");

    var numberX =  (_State.game.getWidth()/2 + 5);
    DayEle.position.x = numberX;

    var TurnEle = TurnTracker.addTextElement("Turn", new PIXI.Text("0", { font : "20px monospace", fill: "white"}), _State, "turn");
    TurnEle.position.x = numberX;
    TurnEle.position.y = (20);

    var Labels = TurnTracker.addGUIElement("Labels", new PIXI.Text("DAY\rTURN", {font: "20px monospace", fill: "white", align: "right", lineHeight: 20}));
    Labels.anchor.x = 1;
    Labels.position.x = (_State.game.getWidth()/2) - 5 ;

    Stage.addChild(TurnTracker.LocalStage);
  };

  this.ResourceGUI = {
    Rations: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),
    Energy: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),
    Ore: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),


    init : function(Stage) {
      var Labels = new PIXI.Text("RATIONS\rENERGY\rORE", {font: "15px monospace", fill: "white", lineHeight: 15});
      Stage.addChild(Labels);
      var numbersX = 75;
      this.Rations.position.x = numbersX;
      Stage.addChild(this.Rations);
      this.Energy.position.x = numbersX;
      this.Energy.position.y = 15;
      Stage.addChild(this.Energy);
      this.Ore.position.x = numbersX;
      this.Ore.position.y = 30;
      Stage.addChild(this.Ore);
    }
  };

  this.CrewStatusGUI = {
    Total: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),
    Unassigned: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),
    Injured: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),

    init : function(Stage) {
      var labelX =  (_State.game.getWidth() - 40);
      var Header = new PIXI.Text("CREW STATUS", {font: "25px monospace", fill: "white", align: "right"});
      Header.anchor.x = 1.0;
      Header.position.x = _State.game.getWidth() - 2;
      Stage.addChild(Header);
      var headerYOff = 25;

      var Labels = new PIXI.Text("TOTAL\rUNASSIGNED\rINJURED", {font: "15px monospace", fill: "white", align: "right", lineHeight: 15});
      Labels.anchor.x = 1.0;
      Labels.position.y = headerYOff;
      Labels.position.x = labelX;
      Stage.addChild(Labels);

      var numberX =  (_State.game.getWidth() - 30);
      var lineYOff = 15;
      this.Total.position.x = numberX;
      this.Total.position.y = headerYOff;
      Stage.addChild(this.Total);
      this.Unassigned.position.x = numberX;
      this.Unassigned.position.y = headerYOff + lineYOff;
      Stage.addChild(this.Unassigned);
      this.Injured.position.x = numberX;
      this.Injured.position.y = headerYOff + lineYOff + lineYOff;
      Stage.addChild(this.Injured);
    }
  };

  this.StatusGUI = {};

  this.TurnSummaryGUI = {};
}

function GUIModule(name) {
  this.name = name;
  this.Elements = {};
  this.LocalStage = new PIXI.Container();

  this.addGUIElement = function(name, obj) {
    this.Elements[name] = new GUIElement(name, obj);
    this.LocalStage.addChild(this.Elements[name].G);
    return this.Elements[name].G;
  };

  this.addTextElement = function(name, PIXIobj, DATAobj, DATAacc) {
    this.Elements[name] = new TextElement(name, PIXIobj, DATAobj, DATAacc);
    this.LocalStage.addChild(this.Elements[name].G);<commit_msg>added return this to GUIModules<commit_after>function GUIModules(state) {
  var _State = state;

  this.Modules = {};
  this.addGUIModule = function(name) {
    this.Modules[name] = new GUIModule(name);
    return this.Modules[name];
  };

  // TODO(david): Move modules to logical objects
  this.init = function(Stage) {
    // NOTE(david): Turn / day GUI
    // TODO(david): Move to a Turn Tracker object?
    var TurnTracker = this.addGUIModule("TurnTracker");
    var DayEle = TurnTracker.addTextElement("Day", new PIXI.Text("0", { font : "20px monospace", fill: "white"}), _State, "day");

    var numberX =  (_State.game.getWidth()/2 + 5);
    DayEle.position.x = numberX;

    var TurnEle = TurnTracker.addTextElement("Turn", new PIXI.Text("0", { font : "20px monospace", fill: "white"}), _State, "turn");
    TurnEle.position.x = numberX;
    TurnEle.position.y = (20);

    var Labels = TurnTracker.addGUIElement("Labels", new PIXI.Text("DAY\rTURN", {font: "20px monospace", fill: "white", align: "right", lineHeight: 20}));
    Labels.anchor.x = 1;
    Labels.position.x = (_State.game.getWidth()/2) - 5 ;

    Stage.addChild(TurnTracker.LocalStage);
  };

  this.ResourceGUI = {
    Rations: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),
    Energy: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),
    Ore: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),


    init : function(Stage) {
      var Labels = new PIXI.Text("RATIONS\rENERGY\rORE", {font: "15px monospace", fill: "white", lineHeight: 15});
      Stage.addChild(Labels);
      var numbersX = 75;
      this.Rations.position.x = numbersX;
      Stage.addChild(this.Rations);
      this.Energy.position.x = numbersX;
      this.Energy.position.y = 15;
      Stage.addChild(this.Energy);
      this.Ore.position.x = numbersX;
      this.Ore.position.y = 30;
      Stage.addChild(this.Ore);
    }
  };

  this.CrewStatusGUI = {
    Total: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),
    Unassigned: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),
    Injured: new PIXI.Text("0", { font : "15px monospace", fill: "white"}),

    init : function(Stage) {
      var labelX =  (_State.game.getWidth() - 40);
      var Header = new PIXI.Text("CREW STATUS", {font: "25px monospace", fill: "white", align: "right"});
      Header.anchor.x = 1.0;
      Header.position.x = _State.game.getWidth() - 2;
      Stage.addChild(Header);
      var headerYOff = 25;

      var Labels = new PIXI.Text("TOTAL\rUNASSIGNED\rINJURED", {font: "15px monospace", fill: "white", align: "right", lineHeight: 15});
      Labels.anchor.x = 1.0;
      Labels.position.y = headerYOff;
      Labels.position.x = labelX;
      Stage.addChild(Labels);

      var numberX =  (_State.game.getWidth() - 30);
      var lineYOff = 15;
      this.Total.position.x = numberX;
      this.Total.position.y = headerYOff;
      Stage.addChild(this.Total);
      this.Unassigned.position.x = numberX;
      this.Unassigned.position.y = headerYOff + lineYOff;
      Stage.addChild(this.Unassigned);
      this.Injured.position.x = numberX;
      this.Injured.position.y = headerYOff + lineYOff + lineYOff;
      Stage.addChild(this.Injured);
    }
  };

  this.StatusGUI = {};

  this.TurnSummaryGUI = {};
  return this;
}

function GUIModule(name) {
  this.name = name;
  this.Elements = {};
  this.LocalStage = new PIXI.Container();

  this.addGUIElement = function(name, obj) {
    this.Elements[name] = new GUIElement(name, obj);
    this.LocalStage.addChild(this.Elements[name].G);
    return this.Elements[name].G;
  };

  this.addTextElement = function(name, PIXIobj, DATAobj, DATAacc) {
    this.Elements[name] = new TextElement(name, PIXIobj, DATAobj, DATAacc);
    this.LocalStage.addChild(this.Elements[name].G);
{'fraction_non_alphanumeric': 0.16187475384009453, 'fraction_numerical': 0.01680451621373244, 'mean_word_length': 3.234574763757643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3914103', 'n_tokens_mistral': 2834, 'n_tokens_neox': 2660, 'n_words': 551}