using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class EmblemSelector : MonoBehaviour
{
    [SerializeField] private int _defaultEmblemCount = 0;
    [SerializeField]
    private TMP_InputField _arcanaEmblems;

    [SerializeField]
    private TMP_InputField _chronoEmblems;

    [SerializeField]
    private TMP_InputField _dragonEmblems;

    [SerializeField]
    private TMP_InputField _druidEmblems;

    [SerializeField]
    private TMP_InputField _eldrichtEmblems;

    [SerializeField]
    private TMP_InputField _faerieEmblems;

    [SerializeField]
    private TMP_InputField _frostEmblems;

    [SerializeField]
    private TMP_InputField _honeymancyEmblems;

    [SerializeField]
    private TMP_InputField _portalEmblems;

    [SerializeField]
    private TMP_InputField _pyroEmblems;

    [SerializeField]
    private TMP_InputField _sugarcraftEmblems;

    [SerializeField]
    private TMP_InputField _witchcraftEmblems;

    [SerializeField]
    private TMP_InputField _bastionEmblems;

    [SerializeField]
    private TMP_InputField _blasterEmblems;

    [SerializeField]
    private TMP_InputField _hunterEmblems;

    [SerializeField]
    private TMP_InputField _incantatorEmblems;

    [SerializeField]
    private TMP_InputField _mageEmblems;

    [SerializeField]
    private TMP_InputField _multistrikerEmblems;

    [SerializeField]
    private TMP_InputField _preserverEmblems;

    [SerializeField]
    private TMP_InputField _scholarEmblems;

    [SerializeField]
    private TMP_InputField _shapeshifterEmblems;

    [SerializeField]
    private TMP_InputField _vanguardEmblems;

    [SerializeField]
    private TMP_InputField _warriorEmblems;

    // Start is called before the first frame update
    void Start() { }

    public Dictionary<int, int> GetEmblems()
    {
        Dictionary<int, int> emblems = new Dictionary<int, int>();
        emblems[(int)TraitsEnum.ARCANA] = int.Parse(_arcanaEmblems.text);
        emblems[(int)TraitsEnum.CHRONO] = int.Parse(_chronoEmblems.text);
        emblems[(int)TraitsEnum.DRAGON] = int.Parse(_dragonEmblems.text);
        emblems[(int)TraitsEnum.DRUID] = int.Parse(_druidEmblems.text);
        emblems[(int)TraitsEnum.ELDRICHT] = int.Parse(_eldrichtEmblems.text);
        emblems[(int)TraitsEnum.FAERIE] = int.Parse(_faerieEmblems.text);
        emblems[(int)TraitsEnum.FROST] = int.Parse(_frostEmblems.text);
        emblems[(int)TraitsEnum.HONEYMANCY] = int.Parse(_honeymancyEmblems.text);
        emblems[(int)TraitsEnum.PORTAL] = int.Parse(_portalEmblems.text);
        emblems[(int)TraitsEnum.PYRO] = int.Parse(_pyroEmblems.text);
        emblems[(int)TraitsEnum.SUGARCRAFT] = int.Parse(_sugarcraftEmblems.text);
        emblems[(int)TraitsEnum.WITCHCRAFT] = int.Parse(_witchcraftEmblems.text);
        emblems[(int)TraitsEnum.BASTION] = int.Parse(_bastionEmblems.text);
        emblems[(int)TraitsEnum.BLASTER] = int.Parse(_blasterEmblems.text);
        emblems[(int)TraitsEnum.HUNTER] = int.Parse(_hunterEmblems.text);
        emblems[(int)TraitsEnum.INCANTATOR] = int.Parse(_incantatorEmblems.text);
        emblems[(int)TraitsEnum.MAGE] = int.Parse(_mageEmblems.text);
        emblems[(int)TraitsEnum.MULTISTRIKER] = int.Parse(_multistrikerEmblems.text);
        emblems[(int)TraitsEnum.PRESERVER] = int.Parse(_preserverEmblems.text);
        emblems[(int)TraitsEnum.SCHOLAR] = int.Parse(_scholarEmblems.text);
        emblems[(int)TraitsEnum.SHAPESHIFTER] = int.Parse(_shapeshifterEmblems.text);
        emblems[(int)TraitsEnum.VANGUARD] = int.Parse(_vanguardEmblems.text);
        emblems[(int)TraitsEnum.WARRIOR] = int.Parse(_warriorEmblems.text);
        return emblems;
    }
    public void Reset()
    {
        _arcanaEmblems.text = _defaultEmblemCount.ToString();
        _chronoEmblems.text = _defaultEmblemCount.ToString();
        _dragonEmblems.text = _defaultEmblemCount.ToString();
        _druidEmblems.text = _defaultEmblemCount.ToString();
        _eldrichtEmblems.text = _defaultEmblemCount.ToString();
        _faerieEmblems.text = _defaultEmblemCount.ToString();
        _frostEmblems.text = _defaultEmblemCount.ToString();
        _honeymancyEmblems.text = _defaultEmblemCount.ToString();
        _portalEmblems.text = _defaultEmblemCount.ToString();
        _pyroEmblems.text = _defaultEmblemCount.ToString();
        _sugarcraftEmblems.text = _defaultEmblemCount.ToString();
        _witchcraftEmblems.text = _defaultEmblemCount.ToString();
        _bastionEmblems.text = _defaultEmblemCount.ToString();
        _blasterEmblems.text = _defaultEmblemCount.ToString();
        _hunterEmblems.text = _defaultEmblemCount.ToString();
        _incantatorEmblems.text = _defaultEmblemCount.ToString();
        _mageEmblems.text = _defaultEmblemCount.ToString();
        _multistrikerEmblems.text = _defaultEmblemCount.ToString();
        _preserverEmblems.text = _defaultEmblemCount.ToString();
        _scholarEmblems.text = _defaultEmblemCount.ToString();
        _shapeshifterEmblems.text = _defaultEmblemCount.ToString();
        _vanguardEmblems.text = _defaultEmblemCount.ToString();
        _warriorEmblems.text = _defaultEmblemCount.ToString();
    }
}
