using UnityEngine;
using System.Collections;

public class SoundDispenser : MonoBehaviour {

	public enum e_music {MONSTER_SPAWN, MONSTER_EATING, YELL1, YELL2, DYING, ALTAR, WIN_MONSTER, WIN_MINIONS};
	
	public AudioSource		sourceEffects;
	public AudioClip				minionCry1;
	public AudioClip				minionCry2;
	public AudioClip				minionDying;
	public AudioClip				monsterSpawn;
	public AudioClip				monsterEating;
	public AudioClip				altarActivated;
	public AudioClip				winMonster;
	public AudioClip				winMinions;
	
	public void PlaySound(e_music newMusic){
		Debug.Log("new sound : " + newMusic.ToString());
		switch (newMusic){
			case e_music.MONSTER_SPAWN : 
				sourceEffects.PlayOneShot(monsterSpawn);
				break;
			case e_music.MONSTER_EATING :
				sourceEffects.PlayOneShot(monsterEating);
				break;
			case e_music.YELL1 :
				sourceEffects.PlayOneShot(minionCry1);
				break;
			case e_music.YELL2 :
				sourceEffects.PlayOneShot(minionCry2);
				break;
			case e_music.DYING : 
				sourceEffects.PlayOneShot(minionDying);
				break;
			case e_music.ALTAR :
				sourceEffects.PlayOneShot(altarActivated);
				break;
			case e_music.WIN_MONSTER :
				sourceEffects.PlayOneShot(winMonster);
				break;
			case e_music.WIN_MINIONS :
				sourceEffects.PlayOneShot(winMinions);
				break;
		}
	}
}
