using TMPro;
using UnityEngine.UI;

namespace eagle {
    public class MovingArmyPopupRowController : TableRowController, System.IDisposable {
        public TMP_Text HeroName;
        public RawImage BattalionImage;
        public TMP_Text BattalionSize;

        private DynamicHeroTextUpdater textUpdater = new DynamicHeroTextUpdater();

        public void SetHeroText(string nameTextId, string fallbackText) {
            textUpdater.SetHeroText(HeroName, nameTextId, fallbackText);
        }

        public void Dispose() { textUpdater?.Dispose(); }

        private void OnDestroy() { Dispose(); }
    }
}