using System; using System.Threading.Tasks; using UnityEngine; namespace DDD { public static class GameEvents { public static TimeScaleChangeEvent RequestTimeScaleChangeEvent = new(); public static FadeInEvent FadeInEvent = new(); public static FadeOutEvent FadeOutEvent = new(); public static OpenPopupUiEvent OpenPopupUiEvent = new(); public static ClosePopupUiEvent ClosePopupUiEvent = new(); public static ShowGlobalMessageEvent RequestShowGlobalMessageEvent = new(); public static InventoryChangedEvent InventoryChangedEvent = new(); } public static class RestaurantEvents { public static ItemSlotSelectedEvent ItemSlotSelectedEvent = new(); public static TodayMenuAddedEvent TodayMenuAddedEvent = new(); public static TodayMenuRemovedEvent TodayMenuRemovedEvent = new(); } // public static class VoyageEvents // { // // Some events... // } public class TimeScaleChangeEvent : IEvent { public object Requester; public float NewTimeScale; } public class FadeInEvent : IEvent { public float Duration; public TaskCompletionSource CompletionSource = new(); public Task WaitAsync() => CompletionSource.Task; } public class FadeOutEvent : IEvent { public float Duration; public TaskCompletionSource CompletionSource = new(); public Task WaitAsync() => CompletionSource.Task; } public class ShowGlobalMessageEvent : IEvent { public string NewMessageKey; public float ShowDuration; public float FadeDuration; } public class OpenPopupUiEvent : IEvent { public Type UiType; } public class ClosePopupUiEvent : IEvent { public Type UiType; } public class InventoryChangedEvent : IEvent { public string ItemId; public int NewCount; } #region RestaurantEvents public class ItemSlotSelectedEvent : IEvent { public ItemViewModel Model; } public class TodayMenuAddedEvent : IEvent {} public class TodayMenuRemovedEvent : IEvent { public RecipeType RecipeType; } #endregion }