<commit_before>var constants = require('../GameConsts'),
	iconHand = '☃',
	iconSword = '⚔';

function WeaponBar() {
	this.element = new createjs.Container();
	this.element.x = 10;
	this.element.y = constants.GAME_HEIGHT - 60;

	this.icon = iconHand;

	this.remainingHitsText = new createjs.Text(iconHand + " 0", "25px Komika", '#fff');
	this.remainingHitsText.x = 50;
	this.remainingHitsText.y = 0;
	this.element.addChild(this.remainingHitsText);
}

WeaponBar.prototype.updateWeapon = function(weapon, remaining) {
	switch (weapon) {
		case 'short-weapon':
			this.icon = iconSword;
			break;

		default:
			this.icon = iconHand;
			break;
	}

	this.updateRemainingHits(remaining);
};

WeaponBar.prototype.updateRemainingHits = function(remaining) {
	this.remainingHitsText.text = this.icon + ' ' + parseInt(remaining);
};

module.exports = WeaponBar;<commit_msg>WeaponBar should not display "NaN"<commit_after>var constants = require('../GameConsts'),
	iconHand = '☃',
	iconSword = '⚔';

function WeaponBar() {
	this.element = new createjs.Container();
	this.element.x = 10;
	this.element.y = constants.GAME_HEIGHT - 60;

	this.icon = iconHand;

	this.remainingHitsText = new createjs.Text(iconHand + " 0", "25px Komika", '#fff');
	this.remainingHitsText.x = 50;
	this.remainingHitsText.y = 0;
	this.element.addChild(this.remainingHitsText);
}

WeaponBar.prototype.updateWeapon = function(weapon, remaining) {
	switch (weapon) {
		case 'short-weapon':
			this.icon = iconSword;
			break;

		default:
			this.icon = iconHand;
			break;
	}

	this.updateRemainingHits(remaining);
};

WeaponBar.prototype.updateRemainingHits = function(remaining) {
	this.remainingHitsText.text = this.icon + ' ' + parseInt(remaining || 0);
};

module.exports = WeaponBar;
{'fraction_non_alphanumeric': 0.14726027397260275, 'fraction_numerical': 0.011986301369863013, 'mean_word_length': 4.565079365079365, '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': '2821385', 'n_tokens_mistral': 686, 'n_tokens_neox': 641, 'n_words': 110}