using System.Collections.Generic;
using System.Linq;
using Net.Eagle0.Eagle.Common;

namespace eagle.Notifications.ARNNotifications {
    using ARNType = NotificationDetails.SealedValueOneofCase;

    public static class GenericNotificationGenerator {
        public static readonly ARNNotificationGenerator Generator = GenerateNotifications;

        public static readonly Dictionary<ARNType, string> TypeNames =
                new() { { ARNType.DivinedDetails, "Divined" } };

        private static IEnumerable<Notification> GenerateNotifications(
                Net.Eagle0.Eagle.Common.Notification notification,
                IGameModel currentModel) {
            yield return Notification.StreamingNotification(
                    title: TypeNames[notification.Details.SealedValueCase],
                    prefixedText: "",
                    llmId: notification.LlmId,
                    provinceIds: notification.AffectedProvinceIds.ToList(),
                    displayedHeroes: notification.AffectedHeroIds
                            .Select(hid => currentModel.Heroes[hid])
                            .ToList());
        }
    }
}