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 OpenScreenUiEvent OpenScreenUiEvent = new(); public static CloseScreenUiEvent CloseScreenUiEvent = new(); public static OpenPopupUiEvent OpenPopupUiEvent = new(); public static ClosePopupUiEvent ClosePopupUiEvent = new(); public static ShowGlobalMessageEvent RequestShowGlobalMessageEvent = new(); public static InteractionEvent Interaction = new(); public static InventoryChangedEvent InventoryChangedEvent = new(); } // public static class RestaurantEvents // { // // Some events... // } // 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; public Task WaitAsync() => CompletionSource.Task; } public class FadeOutEvent : IEvent { public float Duration; public TaskCompletionSource CompletionSource; public Task WaitAsync() => CompletionSource.Task; } public class ShowGlobalMessageEvent : IEvent { public string NewMessageKey; public float ShowDuration; public float FadeDuration; } public class OpenScreenUiEvent : IEvent { public Type UiType; } public class CloseScreenUiEvent : IEvent { public Type UiType; } public class OpenPopupUiEvent : IEvent { public Type UiType; } public class ClosePopupUiEvent : IEvent { public Type UiType; } public class InteractionEvent : IEvent { public GameObject Causer; public GameObject Target; } public class InventoryChangedEvent : IEvent { } }