so 네이밍 변경

This commit is contained in:
NTG_DESKTOP 2025-07-28 04:51:11 +09:00
parent 98354a30a1
commit 94b361f069
6 changed files with 23 additions and 23 deletions

View File

@ -5,8 +5,8 @@
namespace DDD
{
[CreateAssetMenu(fileName = "TodayMenuDataSo", menuName = "GameState/TodayMenuDataSo")]
public class TodayMenuDataSo : GameFlowTask
[CreateAssetMenu(fileName = "RestaurantManagementSo", menuName = "GameState/RestaurantManagementSo")]
public class RestaurantManagementSo : GameFlowTask
{
[ReadOnly, SerializeField] private List<string> _foodRecipeIds = new();
[ReadOnly, SerializeField] private List<string> _drinkRecipeIds = new();

View File

@ -9,7 +9,7 @@ public class InventoryView : MonoBehaviour, IEventHandler<InventoryChangedEvent>
[SerializeField] private Transform _slotParent;
[SerializeField] private GameObject _slotPrefab;
private TodayMenuDataSo _todayMenuDataSo;
private RestaurantManagementSo _restaurantManagementSo;
private InventoryCategoryType _currenInventoryCategoryType = InventoryCategoryType.None;
private readonly Dictionary<string, IInventorySlotUi> _slotLookup = new();
@ -31,8 +31,8 @@ private void OnDisable()
public async Task Initialize()
{
_todayMenuDataSo = await AssetManager.LoadAsset<TodayMenuDataSo>(DataConstants.TodayMenuDataSo);
Debug.Assert(_todayMenuDataSo != null, "_todayMenuDataSo != null");
_restaurantManagementSo = await AssetManager.LoadAsset<RestaurantManagementSo>(DataConstants.RestaurantManagementSo);
Debug.Assert(_restaurantManagementSo != null, "_todayMenuDataSo != null");
Clear();
@ -65,7 +65,7 @@ public void UpdateCategoryView(InventoryCategoryType category)
var model = slot.Model;
// 1. 오늘의 메뉴에 등록된 경우 필터링
bool isRegisteredTodayMenu = model.ItemType == ItemType.Recipe && _todayMenuDataSo.IsContainTodayMenu(id);
bool isRegisteredTodayMenu = model.ItemType == ItemType.Recipe && _restaurantManagementSo.IsContainTodayMenu(id);
// 2. 현재 선택된 카테고리에 맞는지 필터링
bool matchCategory = MatchesCategory(model, _currenInventoryCategoryType);

View File

@ -14,7 +14,7 @@ public enum TodayMenuEventType
public class TodayMenuInteractor : MonoBehaviour, IInteractableUi
{
private IInventorySlotUi _inventorySlotUi;
private TodayMenuDataSo _todayMenuDataSo;
private RestaurantManagementSo _restaurantManagementSo;
private TaskCompletionSource<bool> _isInitialized = new();
private TodayMenuEventType _todayMenuEventType = TodayMenuEventType.None;
@ -27,7 +27,7 @@ public async void Initialize(TodayMenuEventType todayMenuEventType)
{
_todayMenuEventType = todayMenuEventType;
_todayMenuDataSo = await AssetManager.LoadAsset<TodayMenuDataSo>(DataConstants.TodayMenuDataSo);
_restaurantManagementSo = await AssetManager.LoadAsset<RestaurantManagementSo>(DataConstants.RestaurantManagementSo);
_isInitialized.SetResult(true);
}
@ -62,12 +62,12 @@ private void OnAdded()
return;
}
_todayMenuDataSo.TryAddTodayMenu(_inventorySlotUi);
_restaurantManagementSo.TryAddTodayMenu(_inventorySlotUi);
}
private void OnRemoved()
{
_todayMenuDataSo.TryRemoveTodayMenu(_inventorySlotUi);
_restaurantManagementSo.TryRemoveTodayMenu(_inventorySlotUi);
}
}
}

View File

@ -13,23 +13,23 @@ public class TodayMenuView : MonoBehaviour, IEventHandler<TodayMenuAddedEvent>,
private List<IInventorySlotUi> _foodSlots;
private List<IInventorySlotUi> _drinkSlots;
private TodayMenuDataSo _todayMenuDataSo;
private RestaurantManagementSo _restaurantManagementSo;
private async void Start()
{
EventBus.Register<TodayMenuAddedEvent>(this);
EventBus.Register<TodayMenuRemovedEvent>(this);
_todayMenuDataSo = await AssetManager.LoadAsset<TodayMenuDataSo>(DataConstants.TodayMenuDataSo);
_restaurantManagementSo = await AssetManager.LoadAsset<RestaurantManagementSo>(DataConstants.RestaurantManagementSo);
foreach (Transform child in _todayFoodContent)
{
Destroy(child.gameObject);
}
int maxFoodCount = _todayMenuDataSo.MaxFoodCount;
int maxFoodCount = _restaurantManagementSo.MaxFoodCount;
_foodSlots = new List<IInventorySlotUi>(maxFoodCount);
for (int i = 0; i < _todayMenuDataSo.MaxFoodCount; i++)
for (int i = 0; i < _restaurantManagementSo.MaxFoodCount; i++)
{
var go = Instantiate(_slotPrefab, _todayFoodContent);
var slot = go.GetComponent<IInventorySlotUi>();
@ -45,9 +45,9 @@ private async void Start()
Destroy(child.gameObject);
}
int maxDrinkCount = _todayMenuDataSo.MaxDrinkCount;
int maxDrinkCount = _restaurantManagementSo.MaxDrinkCount;
_drinkSlots = new List<IInventorySlotUi>(maxDrinkCount);
for (int i = 0; i < _todayMenuDataSo.MaxDrinkCount; i++)
for (int i = 0; i < _restaurantManagementSo.MaxDrinkCount; i++)
{
var go = Instantiate(_slotPrefab, _todayDrinkContent);
var slot = go.GetComponent<IInventorySlotUi>();
@ -81,9 +81,9 @@ private void UpdateView()
{
for (int i = 0; i < _foodSlots.Count; i++)
{
if (i < _todayMenuDataSo.FoodRecipeIds.Count)
if (i < _restaurantManagementSo.FoodRecipeIds.Count)
{
string recipeId = _todayMenuDataSo.FoodRecipeIds[i];
string recipeId = _restaurantManagementSo.FoodRecipeIds[i];
var model = ItemViewModelFactory.CreateByRecipeId(recipeId);
_foodSlots[i].Initialize(model);
@ -97,9 +97,9 @@ private void UpdateView()
for (int i = 0; i < _drinkSlots.Count; i++)
{
if (i < _todayMenuDataSo.DrinkRecipeIds.Count)
if (i < _restaurantManagementSo.DrinkRecipeIds.Count)
{
string recipeId = _todayMenuDataSo.DrinkRecipeIds[i];
string recipeId = _restaurantManagementSo.DrinkRecipeIds[i];
var model = ItemViewModelFactory.CreateByRecipeId(recipeId);
_drinkSlots[i].Initialize(model);

View File

@ -62,10 +62,10 @@ public async Task OnReadyNewFlow(GameFlowState newFlowState)
{
CreateRestaurantPlayerSo createRestaurantPlayerSoJob = await AssetManager.LoadAsset<CreateRestaurantPlayerSo>(CreateRestaurantPlayerSo);
CreateEnvironmentSo createEnvironmentSoJob = await AssetManager.LoadAsset<CreateEnvironmentSo>(CreateEnvironmentSo);
TodayMenuDataSo todayMenuDataSo = await AssetManager.LoadAsset<TodayMenuDataSo>(DataConstants.TodayMenuDataSo);
RestaurantManagementSo restaurantManagementSo = await AssetManager.LoadAsset<RestaurantManagementSo>(DataConstants.RestaurantManagementSo);
var playerHandle = createRestaurantPlayerSoJob.OnReadyNewFlow(newFlowState);
var propHandle = createEnvironmentSoJob.OnReadyNewFlow(newFlowState);
var todayMenuHandle = todayMenuDataSo.OnReadyNewFlow(newFlowState);
var todayMenuHandle = restaurantManagementSo.OnReadyNewFlow(newFlowState);
// Combine handles and return it
InputManager.Instance.SwitchCurrentActionMap(InputActionMaps.Restaurant);
await Task.WhenAll(playerHandle, propHandle, todayMenuHandle);

View File

@ -19,7 +19,7 @@ public static class DataConstants
public const string EnvironmentDataSo = "EnvironmentDataSo";
public const string RestaurantPlayerDataSo = "RestaurantPlayerDataSo";
public const string UiInputBindingSo = "UiInputBindingSo";
public const string TodayMenuDataSo = "TodayMenuDataSo";
public const string RestaurantManagementSo = "RestaurantManagementSo";
public const string AtlasLabel = "Atlas";
public const string BasePropSpriteMaterial = "BasePropSpriteMaterial";