function HeartGauge(heartManager) {
	this.heartManager = heartManager;
	this.hearts = [];

	var self = this;
	this.heartManager.addOnChangeCountListener(
		function() { self.onChangeCountListener(); }
	);

	this.heartManager.addOnChangeMaxCountListener(
		function() { self.onChangeMaxCountListener(); }
	);

	var startPosX = GAME_SCREEN_SIZE.x - HeartGauge.GAP * 4;
	var posY = 30;
	for(var i = 0; i < HeartManager.HEART_MAX_COUNT; i++) {
		var heart = game.add.sprite(startPosX - i * HeartGauge.GAP, posY, "heart_full");
		heart.anchor.set(0.5);
		heart.scale.set(HeartGauge.HEART_SCALE);
		heart.alpha = 0;
		this.hearts.push(heart);
	}
};

HeartGauge.prototype.onChangeCountListener = function() {
	this.updateHearts();
}

HeartGauge.prototype.onChangeMaxCountListener = function() {
	this.updateHearts();
}

HeartGauge.prototype.start = function() {
	this.updateHearts();
}

HeartGauge.prototype.updateHearts = function() {
	for(var i = 0; i < this.heartManager.getMaxCount(); i++) {
		if(i < this.heartManager.getCount())
			this.hearts[i].loadTexture("heart_full");
		else
			this.hearts[i].loadTexture("heart_empty");

		this.hearts[i].alpha = 1;
	}
}

HeartGauge.loadResources = function() {
	game.load.image('heart_full',		'../../../resources/image/ui/heart_full.png');
	game.load.image('heart_empty',		'../../../resources/image/ui/heart_empty.png');
}

HeartGauge.GAP				= 35;
HeartGauge.HEART_SCALE		= 0.6;