57 lines
1.4 KiB
C#
57 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
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;
|
|
|
|
if (SoldCookingCounts.TryAdd(cookingId, 1) == false)
|
|
{
|
|
SoldCookingCounts[cookingId]++;
|
|
}
|
|
}
|
|
|
|
public void SaveSettlementResult()
|
|
{
|
|
// TODO : 골드 경험치 등 필요 데이터 저장
|
|
}
|
|
|
|
public void CompleteSettlement()
|
|
{
|
|
GameState.Instance.LevelState.IncreaseLevel();
|
|
//_ = ChangeFlow();
|
|
}
|
|
|
|
// private async Task ChangeFlow()
|
|
// {
|
|
//
|
|
// }
|
|
}
|
|
} |