228 lines
7.3 KiB
C#
228 lines
7.3 KiB
C#
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
|
|
|
|
public static Action OnInitializedPlayerInput;
|
|
public static void InvokeInitializedPlayerInput()
|
|
{
|
|
OnInitializedPlayerInput?.Invoke();
|
|
}
|
|
|
|
// Ui
|
|
public static Action<float, float, Color?, float> 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<int, int> OnMaxHealthChanged;
|
|
public static void InvokeMaxHealthChanged(int previousMaxHealthPoint, int changedMaxHealthPoint)
|
|
{
|
|
OnMaxHealthChanged?.Invoke(previousMaxHealthPoint, changedMaxHealthPoint);
|
|
}
|
|
|
|
// 플레이어 현재체력 변경 이벤트
|
|
public static Action<int> OnHealthChanged;
|
|
public static void InvokeHealthChanged(int changedHealthPoint)
|
|
{
|
|
OnHealthChanged?.Invoke(changedHealthPoint);
|
|
}
|
|
|
|
// 플레이어 죽을 때 이벤트
|
|
public static Action OnDead;
|
|
public static void InvokeDead()
|
|
{
|
|
OnDead?.Invoke();
|
|
}
|
|
|
|
// 상호작용
|
|
// 상호작용 Ui 활성화
|
|
public static Action<string> OnShowInteractionUi;
|
|
public static void InvokeShowInteractionUi(string interactionMessage)
|
|
{
|
|
OnShowInteractionUi?.Invoke(interactionMessage);
|
|
}
|
|
|
|
// 상호작용 Ui 비활성화
|
|
public static Action OnHideInteractionUi;
|
|
public static void InvokeHideInteractionUi()
|
|
{
|
|
OnHideInteractionUi?.Invoke();
|
|
}
|
|
|
|
// 플레이어 홀딩 상호작용중 이벤트
|
|
public static Action<float> 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<LevelData> OnLevelUp;
|
|
public static void InvokeLevelUp(LevelData levelData)
|
|
{
|
|
OnLevelUp?.Invoke(levelData);
|
|
}
|
|
|
|
// 플레이어
|
|
// 레벨업 업그레이드 ui 표시 이벤트
|
|
public static Action<LevelData> OnUpgradeUi;
|
|
public static void InvokeUpgradeUi(LevelData levelData)
|
|
{
|
|
OnUpgradeUi?.Invoke(levelData);
|
|
}
|
|
|
|
// 경험치 변경 이벤트
|
|
public static Action<int> OnChangeExp;
|
|
public static void InvokeChangeExp(int addedExp)
|
|
{
|
|
OnChangeExp?.Invoke(addedExp);
|
|
}
|
|
|
|
// 골드 변경 이벤트
|
|
public static Action<int> OnChangeGold;
|
|
public static void InvokeChangeGold(int newGold)
|
|
{
|
|
OnChangeGold?.Invoke(newGold);
|
|
}
|
|
|
|
// 플레이어 칵테일 제조 시작 이벤트
|
|
public static Action OnCocktailStarted;
|
|
public static void InvokeCocktailStarted()
|
|
{
|
|
OnCocktailStarted?.Invoke();
|
|
}
|
|
|
|
// 플레이어 칵테일 제조 완성 이벤트
|
|
public static Action<CocktailData> 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<Customer> OnDestroyCustomer;
|
|
public static void InvokeDestroyCustomer(Customer customer)
|
|
{
|
|
OnDestroyCustomer?.Invoke(customer);
|
|
}
|
|
|
|
// 손님이 칵테일 주문 이벤트
|
|
public static Action<Customer> OnOrderedCocktail;
|
|
public static void InvokeOrderedCocktail(Customer orderedCustomer)
|
|
{
|
|
OnOrderedCocktail?.Invoke(orderedCustomer);
|
|
}
|
|
|
|
// 손님이 칵테일을 받을때 이벤트
|
|
public static Action<CocktailData> OnCocktailServedToCustomer;
|
|
public static void InvokeCocktailServedToCustomer(CocktailData servedCocktailData)
|
|
{
|
|
OnCocktailServedToCustomer?.Invoke(servedCocktailData);
|
|
}
|
|
|
|
// 손님이 칵테일을 받을때 결과 이벤트
|
|
public static Action<Customer, bool> OnOrderResult;
|
|
public static void InvokeOrderResult(Customer orderedCustomer, bool orderedSucceed)
|
|
{
|
|
OnOrderResult?.Invoke(orderedCustomer, orderedSucceed);
|
|
}
|
|
|
|
// 손님의 기다림 게이지를 초기화 시키는 이벤트
|
|
public static Action OnGaugeResetCustomers;
|
|
public static void InvokeGaugeResetCustomers()
|
|
{
|
|
OnGaugeResetCustomers?.Invoke();
|
|
}
|
|
|
|
// Crews
|
|
public static Func<CleanerCrew> OnCreateCleanerCrew;
|
|
public static void InvokeCreateCleanerCrew()
|
|
{
|
|
OnCreateCleanerCrew?.Invoke();
|
|
}
|
|
|
|
public static Func<ServerCrew> OnCreateServerCrew;
|
|
public static void InvokeCreateServerCrew()
|
|
{
|
|
OnCreateServerCrew?.Invoke();
|
|
}
|
|
|
|
public static Func<BartenderCrew> OnCreateBartenderCrew;
|
|
public static void InvokeCreateBartenderCrew()
|
|
{
|
|
OnCreateBartenderCrew?.Invoke();
|
|
}
|
|
|
|
// Props
|
|
// 레스토랑을 전부 청소 이벤트
|
|
public static Action OnCleaningAll;
|
|
public static void InvokeCleaningAll()
|
|
{
|
|
OnCleaningAll?.Invoke();
|
|
}
|
|
|
|
// 모든 배럴의 게이지 추가
|
|
public static Action<int> OnAddBarrels;
|
|
public static void InvokeAddBarrels(int addedValue)
|
|
{
|
|
OnAddBarrels?.Invoke(addedValue);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |