<commit_before>(function(window, Object) {

  var diogenes = {};

  diogenes.Game = function(canvas, width, height, room, items, characters, player) {

    // Canvas context
    this.ctx = canvas.getContext('2d');

    // Dimension
    this.width = width;
    this.height = height;

    // Objects
    this.room = room;
    this.items = items;
    this.characters = characters;
    this.player = player;

    this.draw = (function(ctx) {

      var drawElement = function(elem) {
        elem.draw(ctx, elem.asset, elem.x, elem.y, elem.width, elem.height);
      };

      return function() {
        drawElement(this.room);
        this.items.forEach(drawElement);
      };

    }(this.ctx));

    this.run = function() {
      this.draw();
      window.requestAnimationFrame(this.run.bind(this));
    };

    canvas.addEventListener('click', function(e) {
      console.log(e.pageX, e.pageY);
      items.forEach(function(item) {
        item.isMouseOver(e.pageX, e.pageY, item.x, item.y, item.x+item.width, item.y+item.height);
      });
    });

  };

  diogenes.DrawableEntity = {
    draw: function(ctx) {
      ctx.drawImage(this.asset, this.x, this.y, this.width, this.height);
    }
  };

  diogenes.InteractiveEntity = Object.create(diogenes.DrawableEntity);

  diogenes.InteractiveEntity.isMouseOver = function(x, y) {
      if (x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height) {
        return true;
      }

      return false;
  };

  diogenes.Room = function(id, x, y, width, height, asset) {
    this.id = id;
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
    this.asset = asset;
  };

  diogenes.Room.prototype = Object.create(diogenes.DrawableEntity);


  diogenes.Item = function(id, x, y, width, height, asset) {
    this.id = id;
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
    this.asset = asset;
  };

  diogenes.Item.prototype = Object.create(diogenes.InteractiveEntity);

  diogenes.Character = function() {};

  diogenes.Player = function() {};

  // Make the diogenes object global
  window.diogenes = diogenes;

}(window, Object));<commit_msg>Set up the Items list to a Room instead of a Game<commit_after>(function(window, Object) {

  var diogenes = {};

  diogenes.Game = function(canvas, width, height, room, characters, player) {

    // Canvas context
    this.ctx = canvas.getContext('2d');

    // Dimension
    this.width = width;
    this.height = height;

    // Objects
    this.room = room;
    this.characters = characters;
    this.player = player;

    this.draw = function(ctx) {
      this.room.draw(ctx);
    };

    this.run = function() {
      this.draw(this.ctx);
      window.requestAnimationFrame(this.run.bind(this));
    };

    canvas.addEventListener('click', function(e) {
      console.log(e.pageX, e.pageY);
      room.items.forEach(function(item) {
        item.isMouseOver(e.pageX, e.pageY, item.x, item.y, item.x+item.width, item.y+item.height);
      });
    });

  };

  diogenes.DrawableEntity = {
    draw: function(ctx) {
      ctx.drawImage(this.asset, this.x, this.y, this.width, this.height);
    }
  };

  diogenes.InteractiveEntity = Object.create(diogenes.DrawableEntity);

  diogenes.InteractiveEntity.isMouseOver = function(x, y) {
      if (x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height) {
        return true;
      }

      return false;
  };

  diogenes.Room = function(id, x, y, width, height, asset, items) {
    this.id = id;
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
    this.asset = asset;
    this.items = items;
  };

  diogenes.Room.prototype = {};

  // Draw the Room and all its Items
  diogenes.Room.prototype.draw = function(ctx) {
    ctx.drawImage(this.asset, this.x, this.y, this.width, this.height);
    this.items.forEach(function(item) {
      item.draw(ctx);
    });
  };

  diogenes.Item = function(id, x, y, width, height, asset) {
    this.id = id;
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
    this.asset = asset;
  };

  diogenes.Item.prototype = Object.create(diogenes.InteractiveEntity);

  diogenes.Character = function() {};

  diogenes.Player = function() {};

  // Make the diogenes object global
  window.diogenes = diogenes;

}(window, Object));
{'fraction_non_alphanumeric': 0.15347776510832384, 'fraction_numerical': 0.00045610034207525655, 'mean_word_length': 2.600985221674877, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2672779', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1453, 'n_words': 300}