using System;
using UnityEngine;

public abstract class Status : MonoBehaviour
{
    // 자식 클래스가 반드시 구현해야 할 프로퍼티(속성)들입니다.
    public abstract int Level { get; }
    public abstract float Hp { get; }
    public abstract float MaxHp { get; }
    public abstract float Mp { get; }
    public abstract float MaxMp { get; }
    public abstract float Attack { get; }
    public abstract float Defense { get; }
    public abstract float MoveSpeed { get; }
    public abstract float AtkSpeed { get; }

    public abstract float ApplyDamage(float damage);
}








/*public class Status : MonoBehaviour
{
    [SerializeField]
    protected Data_Status _data;
    public virtual Data_Status Data
    {
        get { return _data; }
        set { _data = value; Init(); }
    }
    
    protected int _hp;
    protected int _mp;
    public int Hp { get {return _hp;} set {_hp = value;} }
    public int Mp { get {return _mp;} set {_mp = value;} }
    
    public int Level => _data != null ? _data.level : 1;
    public int MaxHp => _data != null ? _data.maxHp : 100;
    public int MaxMp => _data != null ? _data.maxMp : 100;
    public float Attack => _data != null ? _data.attack : 10f;
    public float Defense => _data != null ? _data.defense : 5f;
    public float MoveSpeed => _data != null ? _data.moveSpeed : 3f;
    public float AtkSpeed => _data != null ? _data.atkSpeed : 1f;
    
    
    protected virtual void OnValidate()
    {
        if (_data != null) Init();
    }
    
    public virtual void Init()
    {
        Hp = MaxHp;
        Mp = MaxMp;
    }
    
}
/*
[SerializeField]
    protected int _level;
    
    [SerializeField]
    protected int _hp;
    [SerializeField]
    protected int _maxHp;
    [SerializeField]
    protected int _mp;
    [SerializeField]
    protected int _maxMp;
    
    [SerializeField]
    protected int _attack;
    [SerializeField]
    protected int _defense;
    
    [SerializeField]
    protected float _moveSpeed;
    [SerializeField]
    protected float _atkSpeed;
    
    public int Level { get { return _level; } set { _level = value; } }
    
    public int Hp { get { return _hp; } set { _hp = value; } }
    public int MaxHp { get { return _maxHp; } set { _maxHp = value; } }
    public int Mp { get { return _mp; } set { _mp = value; } }
    public int MaxMp { get { return _maxMp; } set { _maxMp = value; } }
    
    public int Attack { get { return _attack; } set { _attack = value; } }
    public int Defense { get { return _defense; } set { _defense = value; } }
    
    public float MoveSpeed { get { return _moveSpeed; } set { _moveSpeed = value; } }
    public float AtkSpeed { get { return _atkSpeed; } set { _atkSpeed = value; } }

    public virtual void Init(Status status)
    {
        Level = status.Level;
        Hp = status.Hp;
        MaxHp = status.MaxHp;
        Mp = status.Mp;
        MaxMp = status.MaxMp;
        Attack = status.Attack;
        Defense = status.Defense;
        MoveSpeed = status.MoveSpeed;
        AtkSpeed = status.AtkSpeed;
        
    }

    public virtual void CopyFrom(Status source)
    {
        Level = source.Level;
        Hp = source.Hp;
        MaxHp = source.MaxHp;
        Mp = source.Mp;
        MaxMp = source.MaxMp;
        Attack = source.Attack;
        Defense = source.Defense;
        MoveSpeed = source.MoveSpeed;
        AtkSpeed = source.AtkSpeed;
    }
}
*/
