using System;
using UnityEngine;
using ui = UnityEngine.UI;

namespace Nan.Scripts
{
    [Serializable]
    [RequireComponent(typeof(ui.Text))]
    public class StatusIndicator : MonoBehaviour
    {
        private const string Atksubfix = "Damage Multiplier: ";
        private const string Defsubfix = "Defense: ";
        private const string Spdsubfix = "Speed: ";
        private const string HPsubfix = "Health: ";
        private ui.Text _text;
        PlayerStatus _playerStatus;

        private void Start()
        {
            _text = GetComponent<ui.Text>();
        }

        private void Update()
        {
            _text.text = HPsubfix + _playerStatus.Health;
            _text.text += "\n" + Atksubfix + "x" + _playerStatus.Attack;
            _text.text += "\n" + Defsubfix + _playerStatus.Defense;
            _text.text += "\n" + Spdsubfix + _playerStatus.Speed;
        }
    }
}