using System.Collections.Generic;
using Net.Eagle0.Eagle.Views;

namespace eagle.Notifications {
    public static class WeatherForcedSuppliesLostNotificationGenerator {
        public static readonly NotificationGenerator Generator = GenerateNotification;

        private static IEnumerable<Notification> GenerateNotification(
                ActionResultView actionResultView,
                IGameModel currentModel) {
            var province = currentModel.Provinces[actionResultView.Province.Value];

            if (actionResultView.Player.Value == currentModel.PlayerId) {
                string noteTitle = "Supplies Lost";
                string noteText =
                        $"We were unable to reach {province.Name} due to weather, had nowhere else to go; our supplies were lost!";

                yield return new Notification(noteTitle, noteText, province.Id);
            }
        }
    }
}