package org.project.entity;

/**
 * The common contract that everything able to fight in the game must follow.
 *
 * Both {@code Player} and {@code Enemy} implement this interface, which is what
 * lets the combat loop treat a Knight and a Dragon the same way (polymorphism):
 * it only ever talks to an {@code Entity}.
 */
public interface Entity {

    /** Perform this entity's basic attack against a target. */
    void attack(Entity target);

    /** Put the entity into a defensive stance for the next incoming hit. */
    void defend();

    /** Restore some health (capped at the maximum). */
    void heal(int health);

    /** Restore some mana/stamina (capped at the maximum). */
    void fillMana(int mana);

    /** Apply incoming damage to this entity. */
    void takeDamage(int damage);

    String getName();

    int getHp();

    int getMaxHP();

    int getMp();

    int getMaxMP();

    /** @return true while the entity still has health left. */
    boolean isAlive();
}
