using System;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

namespace eagle {
    using FactionId = Int32;

    public class FactionTableRow : TableRowController {
        public TMP_Text factionLabel;
        public TMP_Text provinceCountLabel;
        public TMP_Text treatyStatusLabel;
        public Image colorBox;

        private Color _factionColor;

        public string Faction { set => factionLabel.text = value; }

        public string Tooltip { set => GetComponent<HoveringTooltipTextProvider>().text = value; }

        public Color FactionColor {
            get => _factionColor;
            set {
                _factionColor = value;
                colorBox.color = value;
                provinceCountLabel.outlineColor = value;
            }
        }

        public int ProvinceCount { set => provinceCountLabel.text = value.ToString(); }

        public string TruceStatus { set => treatyStatusLabel.text = value; }
    }
}