<commit_before>
Game.Entity = function(properties) {
	properties = properties || {};
	Game.Glyph.call(this,properties);
	this._name = properties['name'] || '';
	this._x = properties['x'] || 1;
	this._y = properties['y'] || 1;
	this._name = properties['name'] || 'Boringtorator';
	this._playercontrolled = properties['playercontrolled'] || false;

	this._map = null;

	this._previews = [];
	this._previewColour = properties['previewColour'] || 'red';

	this._attachedMixins = {};
	this._attachedMixinGroups = {};
	var mixins =  properties['mixins'];
	for (var i = 0; i < mixins.length; i++) {
		for (var key in mixins[i]) {
			if (key !== 'init' && key !== 'name' && !this.hasOwnProperty(key)) {
				this[key] = mixins[i][key];
			}
		}
		this._attachedMixins[mixins[i].name] = true;

        if (mixins[i].groupName) {
            this._attachedMixinGroups[mixins[i].groupName] = true;
        }

        if (mixins[i].init) {
            mixins[i].init.call(this, properties);
        }
	}

}

Game.Entity.extend(Game.Glyph);

Game.Entity.prototype.setName = function(name) {
	this._name = name;
}

Game.Entity.prototype.setX = function(x) {
	this._x = x;
}

Game.Entity.prototype.setY = function(y) {
	this._y = y;
}

Game.Entity.prototype.getName = function() {
	return this._name;
}

Game.Entity.prototype.getX = function() {
	return this._x;
}

Game.Entity.prototype.getY = function() {
	return this._y;
}

Game.Entity.prototype.setMap = function(map) {
	this._map = map;
}

Game.Entity.prototype.getMap = function() {
	return this._map;
}

Game.Entity.prototype.hasMixin = function(obj) {
	if (typeof obj === 'object') {
		return this._attachedMixins[obj.name];
	}
	else {
		return this._attachedMixins[obj] || this._attachedMixinGroups[obj];
	}
}

//Get the manhattan distance to another entity
Game.Entity.prototype.getDist = function(entity) {
	return Math.abs(this.getX()-entity.getX()) + Math.abs(this.getY()-entity.getY());
}<commit_msg>distance calculation<commit_after>
Game.Entity = function(properties) {
	properties = properties || {};
	Game.Glyph.call(this,properties);
	this._name = properties['name'] || '';
	this._x = properties['x'] || 1;
	this._y = properties['y'] || 1;
	this._name = properties['name'] || 'Boringtorator';
	this._playercontrolled = properties['playercontrolled'] || false;

	this._map = null;

	this._previews = [];
	this._previewColour = properties['previewColour'] || 'red';

	this._attachedMixins = {};
	this._attachedMixinGroups = {};
	var mixins =  properties['mixins'];
	for (var i = 0; i < mixins.length; i++) {
		for (var key in mixins[i]) {
			if (key !== 'init' && key !== 'name' && !this.hasOwnProperty(key)) {
				this[key] = mixins[i][key];
			}
		}
		this._attachedMixins[mixins[i].name] = true;

        if (mixins[i].groupName) {
            this._attachedMixinGroups[mixins[i].groupName] = true;
        }

        if (mixins[i].init) {
            mixins[i].init.call(this, properties);
        }
	}

}

Game.Entity.extend(Game.Glyph);

Game.Entity.prototype.setName = function(name) {
	this._name = name;
}

Game.Entity.prototype.setX = function(x) {
	this._x = x;
}

Game.Entity.prototype.setY = function(y) {
	this._y = y;
}

Game.Entity.prototype.getName = function() {
	return this._name;
}

Game.Entity.prototype.getX = function() {
	return this._x;
}

Game.Entity.prototype.getY = function() {
	return this._y;
}

Game.Entity.prototype.setMap = function(map) {
	this._map = map;
}

Game.Entity.prototype.getMap = function() {
	return this._map;
}

Game.Entity.prototype.hasMixin = function(obj) {
	if (typeof obj === 'object') {
		return this._attachedMixins[obj.name];
	}
	else {
		return this._attachedMixins[obj] || this._attachedMixinGroups[obj];
	}
}

//Get the number of steps to another entity, ignoring obstacles
Game.Entity.prototype.getDist = function(entity) {
	return Math.max(this.getX()-entity.getX()), Math.abs(this.getY()-entity.getY());
}
{'fraction_non_alphanumeric': 0.17623055343024738, 'fraction_numerical': 0.001530221882172915, 'mean_word_length': 3.8300492610837438, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2426595', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1386, 'n_words': 240}