<commit_before>  function Tile(init)
  {
    $.extend(this, {
      solid: false,
      angle_tl: false,
      angle_tr: false,
      angle_bl: false,
      angle_br: false,

      background: null,
      foreground: null,
      combined:   null,
    }, init)

    this.combine = function()
    {
      // TODO
      this.combined = this.background;
    }
  }

  function Tiles(init)
  {
    var self = this;

    var default_tile_info = {
      0: { solid: false },
      1: { solid: true },
    }

    var tile_info = init.tile_info || default_tile_info
    delete init.tile_info;

    $.extend(self, {
      background: "empty.png",
      foreground: "empty.png",

      tiles_bd: 0,
      tiles_xw: 10,
      tiles_yh: 10,

      tiles_rxw: null,
      tiles_ryh: null,
    }, init)

    self.loaded = false;

    self.tiles_rxw = self.tiles_xw + (2 * self.tiles_bd)
    self.tiles_ryh = self.tiles_yh + (2 * self.tiles_bd)

    self.add_tile_info = function(additional)
    {
      $.each(additional, function(i, v)
      {
        if (!$.isNumeric(i))
          return;

        self[i] = new Tile(v)
      })

      if ( self.loaded )
      {
        do_splits()
      }
    }

    var do_splits = function()
    {
      self.loaded = true;
      split_tiles("background")
      split_tiles("foreground")
      runtime.events.emit('tiles_done', self);
    }

    var split_tiles = function(attr)
    {
      var gfx = self[attr]
      var tiles_on_dom = $("<div/>")
        .appendTo(content)

      var img = gfx.canvas

      var tiles_count_x = (img.width  / self.tiles_rxw) | 0
      var tiles_count_y = (img.height / self.tiles_ryh) | 0<commit_msg>Add a quick accessor for all of the valid tiles<commit_after>  function Tile(init)
  {
    $.extend(this, {
      solid: false,
      angle_tl: false,
      angle_tr: false,
      angle_bl: false,
      angle_br: false,

      background: null,
      foreground: null,
      combined:   null,
    }, init)

    this.combine = function()
    {
      // TODO
      this.combined = this.background;
    }
  }

  function Tiles(init)
  {
    var self = this;

    var default_tile_info = {
      0: { solid: false },
      1: { solid: true },
    }

    var tile_info = init.tile_info || default_tile_info
    delete init.tile_info;

    $.extend(self, {
      background: "empty.png",
      foreground: "empty.png",

      tiles_bd: 0,
      tiles_xw: 10,
      tiles_yh: 10,

      tiles_rxw: null,
      tiles_ryh: null,
    }, init)

    self.loaded = false;

    self.tiles_rxw = self.tiles_xw + (2 * self.tiles_bd)
    self.tiles_ryh = self.tiles_yh + (2 * self.tiles_bd)

    self.add_tile_info = function(additional)
    {
      $.each(additional, function(i, v)
      {
        if (!$.isNumeric(i))
          return;

        self[i] = new Tile(v)
      })

      if ( self.loaded )
      {
        do_splits()
      }
    }

    self.all_tiles = function()
    {
      var result = [];

      $.each(self, function(i, tile)
      {
        if (!$.isNumeric(i))
          return;

        result[i] = tile;
      })

      return result
    }

    var do_splits = function()
    {
      self.loaded = true;
      split_tiles("background")
      split_tiles("foreground")
      runtime.events.emit('tiles_done', self);
    }

    var split_tiles = function(attr)
    {
      var gfx = self[attr]
      var tiles_on_dom = $("<div/>")
        .appendTo(content)

      var img = gfx.canvas

      var tiles_count_x = (img.width  / self.tiles_rxw) | 0
      var tiles_count_y = (img.height / self.tiles_ryh) | 0
{'fraction_non_alphanumeric': 0.125979843225084, 'fraction_numerical': 0.006159014557670772, 'mean_word_length': 1.8606885508406725, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3768781', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1270, 'n_words': 256}