using System; using BlueWater.Items; using BlueWater.Npcs.Crews.Bartender; using BlueWater.Npcs.Crews.Cleaner; using BlueWater.Npcs.Crews.Server; using BlueWater.Npcs.Customers; using UnityEngine; namespace BlueWater { public static class EventManager { // Global events #region Global events // Ui public static Action OnFadeInOut; public static void InvokeFadeInOut(float fadeInTime, float fadeOutTime, Color? fadeColor = null, float delayAfterFadeIn = 0f) { OnFadeInOut?.Invoke(fadeInTime, fadeOutTime, fadeColor, delayAfterFadeIn); } // Player // 플레이어 최대체력 변경 이벤트 public static Action OnMaxHealthChanged; public static void InvokeMaxHealthChanged(int previousMaxHealthPoint, int changedMaxHealthPoint) { OnMaxHealthChanged?.Invoke(previousMaxHealthPoint, changedMaxHealthPoint); } // 플레이어 현재체력 변경 이벤트 public static Action OnHealthChanged; public static void InvokeHealthChanged(int changedHealthPoint) { OnHealthChanged?.Invoke(changedHealthPoint); } // 플레이어 죽을 때 이벤트 public static Action OnDead; public static void InvokeDead() { OnDead?.Invoke(); } // 상호작용 // 상호작용 Ui 활성화 public static Action OnShowInteractionUi; public static void InvokeShowInteractionUi(string interactionMessage) { OnShowInteractionUi?.Invoke(interactionMessage); } // 상호작용 Ui 비활성화 public static Action OnHideInteractionUi; public static void InvokeHideInteractionUi() { OnHideInteractionUi?.Invoke(); } // 플레이어 홀딩 상호작용중 이벤트 public static Action OnHoldInteracting; public static void InvokeHoldInteracting(float value) { OnHoldInteracting?.Invoke(value); } #endregion // Tycoon events #region Tycoon events // 타이쿤 시작 이벤트 public static Action OnTycoonGameStarted; public static void InvokeTycoonGameStarted() { OnTycoonGameStarted?.Invoke(); } // 타이쿤 종료 이벤트 (OnDead 이벤트로 대체중) public static Action OnTycoonGameOvered; public static void InvokeTycoonGameOvered() { OnTycoonGameOvered?.Invoke(); } // 플레이어 // 레벨업 이벤트 public static Action OnLevelUp; public static void InvokeLevelUp(LevelData levelData) { OnLevelUp?.Invoke(levelData); } // 경험치 변경 이벤트 public static Action OnChangeExp; public static void InvokeChangeExp(int addedExp) { OnChangeExp?.Invoke(addedExp); } // 골드 변경 이벤트 public static Action OnChangeGold; public static void InvokeChangeGold(int newGold) { OnChangeGold?.Invoke(newGold); } // 플레이어 칵테일 제조 시작 이벤트 public static Action OnCocktailStarted; public static void InvokeCocktailStarted() { OnCocktailStarted?.Invoke(); } // 플레이어 칵테일 제조 완성 이벤트 public static Action OnCocktailCompleted; public static void InvokeCocktailCompleted(CocktailData completedCocktail) { OnCocktailCompleted?.Invoke(completedCocktail); } // 플레이어가 들고있는 칵테일 버리기 이벤트 public static Action OnCocktailDiscarded; public static void InvokeCocktailDiscarded() { OnCocktailDiscarded?.Invoke(); } // 플레이어가 들고있는 칵테일을 서빙테이블에 올려두는 이벤트 public static Action OnPlaceOnServingTable; public static void InvokePlaceOnServingTable() { OnPlaceOnServingTable?.Invoke(); } // Npc // 손님 생성 이벤트 public static Action OnCreateCustomer; public static void InvokeCreateCustomer() { OnCreateCustomer?.Invoke(); } public static Action OnDestroyCustomer; public static void InvokeDestroyCustomer(Customer customer) { OnDestroyCustomer?.Invoke(customer); } // 손님이 칵테일 주문 이벤트 public static Action OnOrderedCocktail; public static void InvokeOrderedCocktail(Customer orderedCustomer) { OnOrderedCocktail?.Invoke(orderedCustomer); } // 손님이 칵테일을 받을때 이벤트 public static Action OnCocktailServedToCustomer; public static void InvokeCocktailServedToCustomer(CocktailData servedCocktailData) { OnCocktailServedToCustomer?.Invoke(servedCocktailData); } // 손님이 칵테일을 받을때 결과 이벤트 public static Action OnOrderResult; public static void InvokeOrderResult(Customer orderedCustomer, bool orderedSucceed) { OnOrderResult?.Invoke(orderedCustomer, orderedSucceed); } // Crews public static Func OnCreateCleanerCrew; public static void InvokeCreateCleanerCrew() { OnCreateCleanerCrew?.Invoke(); } public static Func OnCreateServerCrew; public static void InvokeCreateServerCrew() { OnCreateServerCrew?.Invoke(); } public static Func OnCreateBartenderCrew; public static void InvokeCreateBartenderCrew() { OnCreateBartenderCrew?.Invoke(); } #endregion } }