using System;
using System.Runtime.InteropServices;
using UnityEngine;
using ui = UnityEngine.UI;
using UniRx;

namespace Nan.Scripts
{
    [Serializable]
    public class PlayerStatus
    {
        [SerializeField] private float _health;
        [SerializeField] private float _attack;
        [SerializeField] private float _defense;
        [SerializeField] private float _speed;
        [SerializeField] private int _score;

        public static readonly float MaxAttack = 1;
        public static readonly float MaxDefence = 1;
        public static readonly float MaxSpeed = 1;
        
        public float Health
        {
            get { return _health; }
            set { _health = Mathf.Min(value, 1); }
        }

        public float Attack
        {
            get { return _attack; }
            set { _attack = value; }
        }

        public float Defense
        {
            get { return _defense; }
            set { _defense = value; }
        }

        public float AttackForDefence {
            get { return _defense; }
        }

        public float Speed
        {
            get { return _speed; }
            set { _speed = value; }
        }

        public int Score
        {
            get { return _score; }
            set { _score = value; }
        }

        public PlayerStatus()
        {
            Health = 1;
            _attack = 1f;
            _defense = 1f;
            _speed= 1f;
            Score = 0;
        }
    }
}