diff --git a/Assets/_DDD/_Scripts/GameState/TodayMenuDataSo.cs b/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs similarity index 93% rename from Assets/_DDD/_Scripts/GameState/TodayMenuDataSo.cs rename to Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs index c93d5a04e..b3ae982b2 100644 --- a/Assets/_DDD/_Scripts/GameState/TodayMenuDataSo.cs +++ b/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs @@ -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 _foodRecipeIds = new(); [ReadOnly, SerializeField] private List _drinkRecipeIds = new(); diff --git a/Assets/_DDD/_Scripts/GameUi/New/InventoryView.cs b/Assets/_DDD/_Scripts/GameUi/New/InventoryView.cs index 63d90aa0d..b1249a5ce 100644 --- a/Assets/_DDD/_Scripts/GameUi/New/InventoryView.cs +++ b/Assets/_DDD/_Scripts/GameUi/New/InventoryView.cs @@ -9,7 +9,7 @@ public class InventoryView : MonoBehaviour, IEventHandler [SerializeField] private Transform _slotParent; [SerializeField] private GameObject _slotPrefab; - private TodayMenuDataSo _todayMenuDataSo; + private RestaurantManagementSo _restaurantManagementSo; private InventoryCategoryType _currenInventoryCategoryType = InventoryCategoryType.None; private readonly Dictionary _slotLookup = new(); @@ -31,8 +31,8 @@ private void OnDisable() public async Task Initialize() { - _todayMenuDataSo = await AssetManager.LoadAsset(DataConstants.TodayMenuDataSo); - Debug.Assert(_todayMenuDataSo != null, "_todayMenuDataSo != null"); + _restaurantManagementSo = await AssetManager.LoadAsset(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); diff --git a/Assets/_DDD/_Scripts/GameUi/New/TodayMenuInteractor.cs b/Assets/_DDD/_Scripts/GameUi/New/TodayMenuInteractor.cs index 1f7cefa9c..438604462 100644 --- a/Assets/_DDD/_Scripts/GameUi/New/TodayMenuInteractor.cs +++ b/Assets/_DDD/_Scripts/GameUi/New/TodayMenuInteractor.cs @@ -14,7 +14,7 @@ public enum TodayMenuEventType public class TodayMenuInteractor : MonoBehaviour, IInteractableUi { private IInventorySlotUi _inventorySlotUi; - private TodayMenuDataSo _todayMenuDataSo; + private RestaurantManagementSo _restaurantManagementSo; private TaskCompletionSource _isInitialized = new(); private TodayMenuEventType _todayMenuEventType = TodayMenuEventType.None; @@ -27,7 +27,7 @@ public async void Initialize(TodayMenuEventType todayMenuEventType) { _todayMenuEventType = todayMenuEventType; - _todayMenuDataSo = await AssetManager.LoadAsset(DataConstants.TodayMenuDataSo); + _restaurantManagementSo = await AssetManager.LoadAsset(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); } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/New/TodayMenuView.cs b/Assets/_DDD/_Scripts/GameUi/New/TodayMenuView.cs index 811429e69..67b2c343f 100644 --- a/Assets/_DDD/_Scripts/GameUi/New/TodayMenuView.cs +++ b/Assets/_DDD/_Scripts/GameUi/New/TodayMenuView.cs @@ -13,23 +13,23 @@ public class TodayMenuView : MonoBehaviour, IEventHandler, private List _foodSlots; private List _drinkSlots; - private TodayMenuDataSo _todayMenuDataSo; + private RestaurantManagementSo _restaurantManagementSo; private async void Start() { EventBus.Register(this); EventBus.Register(this); - _todayMenuDataSo = await AssetManager.LoadAsset(DataConstants.TodayMenuDataSo); + _restaurantManagementSo = await AssetManager.LoadAsset(DataConstants.RestaurantManagementSo); foreach (Transform child in _todayFoodContent) { Destroy(child.gameObject); } - int maxFoodCount = _todayMenuDataSo.MaxFoodCount; + int maxFoodCount = _restaurantManagementSo.MaxFoodCount; _foodSlots = new List(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(); @@ -45,9 +45,9 @@ private async void Start() Destroy(child.gameObject); } - int maxDrinkCount = _todayMenuDataSo.MaxDrinkCount; + int maxDrinkCount = _restaurantManagementSo.MaxDrinkCount; _drinkSlots = new List(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(); @@ -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); diff --git a/Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs b/Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs index a2cfb2194..5d16cc946 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs +++ b/Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs @@ -62,10 +62,10 @@ public async Task OnReadyNewFlow(GameFlowState newFlowState) { CreateRestaurantPlayerSo createRestaurantPlayerSoJob = await AssetManager.LoadAsset(CreateRestaurantPlayerSo); CreateEnvironmentSo createEnvironmentSoJob = await AssetManager.LoadAsset(CreateEnvironmentSo); - TodayMenuDataSo todayMenuDataSo = await AssetManager.LoadAsset(DataConstants.TodayMenuDataSo); + RestaurantManagementSo restaurantManagementSo = await AssetManager.LoadAsset(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); diff --git a/Assets/_DDD/_Scripts/Utilities/Constants.cs b/Assets/_DDD/_Scripts/Utilities/Constants.cs index 93709fb07..1a834036e 100644 --- a/Assets/_DDD/_Scripts/Utilities/Constants.cs +++ b/Assets/_DDD/_Scripts/Utilities/Constants.cs @@ -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";