using UnityEngine;
using System.Collections;

public class DamageDealer : MonoBehaviour {

    // Attribute. Public, so defined in Inspector. Dirty. 
    public string type;
    private string WATCHER = "Watcher";
    private string DEMON = "Demon";

    // Set the damage to the "type" component of the GameObject.
    public void setDamage(int d) {
        if (type == this.WATCHER) {
            EnemyWatcher e = (EnemyWatcher) this.gameObject.GetComponent<EnemyWatcher>();
            e.setDamage(d);
        } else if (type == this.DEMON) {
            EnemyDemon e = (EnemyDemon)this.gameObject.GetComponent<EnemyDemon>();
            e.setDamage(d);
        }    
    }
}
