ProjectDDD/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantSettlementState.cs

57 lines
1.4 KiB
C#
Raw Normal View History

2025-09-02 09:44:20 +00:00
using System.Collections.Generic;
2025-09-02 12:34:18 +00:00
using System.Threading.Tasks;
2025-09-02 09:44:20 +00:00
using UnityEngine;
namespace DDD.Restaurant
{
public class RestaurantSettlementState : ScriptableObject
{
public int TotalRevenue;
public int NormalCustomers;
public int SpecialCustomers;
public Dictionary<string, int> SoldCookingCounts;
public void InitializeState()
{
TotalRevenue = 0;
NormalCustomers = 0;
SpecialCustomers = 0;
SoldCookingCounts = new Dictionary<string, int>();
}
public void CustomerSettlement(CustomerType customerType, int price, string cookingId)
{
if (customerType == CustomerType.Normal)
{
NormalCustomers++;
}
else if (customerType == CustomerType.Special)
{
SpecialCustomers++;
}
TotalRevenue += price;
2025-09-02 12:34:18 +00:00
if (SoldCookingCounts.TryAdd(cookingId, 1) == false)
{
SoldCookingCounts[cookingId]++;
}
2025-09-02 09:44:20 +00:00
}
public void SaveSettlementResult()
{
// TODO : 골드 경험치 등 필요 데이터 저장
}
2025-09-02 12:34:18 +00:00
public void CompleteSettlement()
{
GameState.Instance.LevelState.IncreaseLevel();
//_ = ChangeFlow();
}
// private async Task ChangeFlow()
// {
//
// }
2025-09-02 09:44:20 +00:00
}
}