<commit_before>define(['sprites'], function (Sprites) {

	var Entity = Class.extend({
		init: function (id, kind) {
			this.id = id;
			this.kind = kind;
			this.movieclip = {
				position: new PIXI.Point()
			};
			this._container = new PIXI.DisplayObjectContainer();
		},
		getDisplayObject: function () {
			return this._container;
		},
		getPosition: function () {
			return this.movieclip.position;
		},
		setPosition: function (x, y) {
			this.movieclip.position.x = x * 100;
			this.movieclip.position.y = y * 100;
		},
		getAngle: function () {
			return this.movieclip.rotation;
		},
		setAngle: function () {
			// this.movieclip.rotation = a;
		},
		setAnimation: function (sprite, animation) {
			if (sprite === undefined || animation === undefined) return;
			if (animation !== this.animation) {
				var def = Sprites.definitions[sprite];
				var adef = def.animations[animation];
				var movieclip = new PIXI.MovieClip(adef.textures);

				if (this.isAnimated())
					this._container.removeChild(this.movieclip);
				this.movieclip = movieclip;
				this._container.addChild(this.movieclip);

				this._container.position = def.offset;
				this.movieclip.animationSpeed = adef.speed;
				this.movieclip.scale = adef.scale;
				this.movieclip.anchor = def.anchor;
				this.movieclip.play();
				this.animation = animation;
			}
		},
		isAnimated: function () {
			return this.movieclip instanceof PIXI.MovieClip;
		},
		update: function (entity_info) {
			this.setAnimation(entity_info.sprite || this.kind, entity_info.animation);<commit_msg>simplify entity.js<commit_after>define(['sprites'], function (Sprites) {

	var Entity = Class.extend({
		init: function (id, kind) {
			this.id = id;
			this.kind = kind;
			this.movieclip = {
				position: new PIXI.Point()
			};
			this._container = new PIXI.DisplayObjectContainer();
		},
		getDisplayObject: function () {
			return this._container;
		},
		getPosition: function () {
			return this.movieclip.position;
		},
		setPosition: function (x, y) {
			this.movieclip.position.x = x * 100;
			this.movieclip.position.y = y * 100;
		},
		getAngle: function () {
			return this.movieclip.rotation;
		},
		setAngle: function () {
			// this.movieclip.rotation = a;
		},
		setAnimation: function (sprite, animation) {
			if (sprite === undefined || animation === undefined || animation === this.animation) return;

			var def = Sprites.definitions[sprite];
			var adef = def.animations[animation];
			var movieclip = new PIXI.MovieClip(adef.textures);

			if (this.isAnimated()) this._container.removeChild(this.movieclip);
			this.movieclip = movieclip;
			this._container.addChild(this.movieclip);

			this._container.position = def.offset;
			this.movieclip.animationSpeed = adef.speed;
			this.movieclip.scale = adef.scale;
			this.movieclip.anchor = def.anchor;
			this.movieclip.play();
			this.animation = animation;

		},
		isAnimated: function () {
			return this.movieclip instanceof PIXI.MovieClip;
		},
		update: function (entity_info) {
			this.setAnimation(entity_info.sprite || this.kind, entity_info.animation);
{'fraction_non_alphanumeric': 0.13836681788723265, 'fraction_numerical': 0.0038885288399222295, 'mean_word_length': 3.5530973451327434, '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': '1655865', 'n_tokens_mistral': 1208, 'n_tokens_neox': 988, 'n_words': 197}