<commit_before>/**
 * Unramalak.BaseCell
 */
Unramalak.Container('Unramalak.BaseCell', {}, {
  land: null,
  shape: null,
  data: {
    x: null,
    y: null
  },

  init: function (shape, data) {
    this.data = data;
    this.shape = shape;
    this.land = new Unramalak.Land();

    if (!this.data.background) {
      this.data.background = defaultBackgroundColor;
    }
    if (this.data.type) {
      this.land.type = this.data.type;
    }
  },

  bind: function (event, callback) {
    this.shape.attach(event, callback);
  },

  /**
   * Return a json string of the cell
   * @returns object
   */
  toJson: function () {
    return {
      x: this.data.x,
      y: this.data.y,
      type: this.land.type
    };
  }
});

/**
 * Unramalak.Cell
 */
Unramalak.BaseCell('Unramalak.Cell', {}, {
  /**
   * Return the point on the top of the shape
   * @returns Point
   */
  getHighPoint: function () {
    return this.shape.segments[1].point;
  },

  getCenter: function () {
    return this.shape.position;
  },

  render: function () {
    var render = this.land.render();

    // default render
    if (render.type == 'default') {
      this.shape.fillColor = render.value;
    }
    else if (render.type == 'image') {
      var image = Unramalak.ImageLoader.getRaster('land_plains');

      image.position = this.getCenter();
      //image.scale(0.580);

      //var point = paper.Point(10, 10);
      //point.selected = true;
      //point.fillColor = 'red';
    }
    //console.log('render', this.shape.position, render);
    this.shape.strokeColor = defaultStrokeColor;
  }
});


$.Class('Unramalak.Land', {}, {
  type: 'default',
  image: null,

  render: function () {
    var render = {
      type: 'default',
      value: defaultBackgroundColor
    };
    // TODO put textures here
    if (this.type == 'sand') {
      render.value = 'yellow';<commit_msg>correction on map drag (in progress...)<commit_after>/**
 * Unramalak.BaseCell
 */
Unramalak.Container('Unramalak.BaseCell', {}, {
  land: null,
  shape: null,
  data: {
    x: null,
    y: null
  },

  init: function (shape, data) {
    this.data = data;
    this.shape = shape;
    this.land = new Unramalak.Land();

    if (!this.data.background) {
      this.data.background = defaultBackgroundColor;
    }
    if (this.data.type) {
      this.land.type = this.data.type;
    }
  },

  bind: function (event, callback) {
    this.shape.attach(event, callback);
  },

  /**
   * Return a json string of the cell
   * @returns object
   */
  toJson: function () {
    return {
      x: this.data.x,
      y: this.data.y,
      type: this.land.type
    };
  }
});

/**
 * Unramalak.Cell
 */
Unramalak.BaseCell('Unramalak.Cell', {}, {
  /**
   * Return the point on the top of the shape
   * @returns Point
   */
  getHighPoint: function () {
    return this.shape.segments[1].point;
  },

  getCenter: function () {
    return this.shape.position;
  },

  render: function () {
    var render = this.land.render();

    // default render
    if (render.type == 'default') {
      this.shape.fillColor = render.value;
    }
    else if (render.type == 'image') {
      var image = Unramalak.ImageLoader.getRaster('land_plains');
      image.setPosition(this.getCenter());
      //image.scale(0.580);

      //var point = paper.Point(10, 10);
      //point.selected = true;
      //point.fillColor = 'red';
    }
    //console.log('render', this.shape.position, render);
    this.shape.strokeColor = defaultStrokeColor;
  }
});


$.Class('Unramalak.Land', {}, {
  type: 'default',
  image: null,

  render: function () {
    var render = {
      type: 'default',
      value: defaultBackgroundColor
    };
    // TODO put textures here
    if (this.type == 'sand') {
      render.value = 'yellow';
{'fraction_non_alphanumeric': 0.16254980079681275, 'fraction_numerical': 0.004780876494023904, 'mean_word_length': 2.3625, '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': '1919422', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1271, 'n_words': 269}