package org.project.entity.enemies;

import org.project.entity.Entity;
import org.project.item.weapons.Weapon;

// TODO: UPDATE IMPLEMENTATION
public abstract class Enemy implements Entity {
    protected Weapon weapon;

    private int hp;
    private int maxHP;

    private int mp;
    private int maxMP;

    public Enemy(int hp, int mp, Weapon weapon) {
        this.hp = hp;
        this.maxHP= hp;

        this.mp = mp;
        this.maxMP= mp;

        this.weapon = weapon;
    }

    @Override
    public void takeDamage(int damage) {

        hp -= damage;
        if (hp < 0) hp = 0;
    }
    @Override
    public void heal(int health){
        hp+= health;
        if (hp>maxHP){
            hp=maxHP;
        }
    }
    public int getHp() {
        return hp;
    }
    public int getMaxHP(){
        return maxHP;
    }
    public int getMp() {
        return mp;
    }
    public int getMaxMP(){
        return maxMP;
    }
    public Weapon getWeapon() {
        return weapon;
    }
}
