2024-07-06 12:13:58 +00:00
|
|
|
using System;
|
2024-07-15 16:20:39 +00:00
|
|
|
using System.Collections.Generic;
|
2024-07-06 12:13:58 +00:00
|
|
|
using BlueWater.Interfaces;
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace BlueWater.Items
|
|
|
|
{
|
|
|
|
public enum FoodType
|
|
|
|
{
|
|
|
|
None = 0,
|
2024-07-10 00:22:34 +00:00
|
|
|
Skewer,
|
2024-07-06 12:13:58 +00:00
|
|
|
Soup,
|
2024-07-20 11:32:54 +00:00
|
|
|
Grill,
|
2024-07-06 12:13:58 +00:00
|
|
|
Dessert,
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum FoodTaste
|
|
|
|
{
|
|
|
|
None = 0,
|
|
|
|
Savory,
|
|
|
|
Spicy,
|
|
|
|
Salty,
|
|
|
|
Sweet
|
|
|
|
}
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
public class FoodData : IIdx
|
|
|
|
{
|
|
|
|
[BoxGroup("Json 데이터 영역")]
|
|
|
|
[field: SerializeField, Tooltip("고유 식별 ID"), BoxGroup("Json 데이터 영역")]
|
|
|
|
public int Idx { get; set; }
|
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("이름"), BoxGroup("Json 데이터 영역")]
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("음식의 종류"), BoxGroup("Json 데이터 영역")]
|
|
|
|
public FoodType Type { get; set; }
|
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("음식의 맛"), BoxGroup("Json 데이터 영역")]
|
|
|
|
public FoodTaste Taste { get; set; }
|
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("음식 제작 시간"), BoxGroup("Json 데이터 영역")]
|
2024-07-08 20:06:22 +00:00
|
|
|
public int CookGauge { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("음식 제작에 나오는 접시 수"), BoxGroup("Json 데이터 영역")]
|
|
|
|
public int Plate { get; set; }
|
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("1번 재료 식별 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientIdx1 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("1번 재료 수량 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientQuantity1 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("2번 재료 식별 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientIdx2 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("2번 재료 수량 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientQuantity2 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("3번 재료 식별 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientIdx3 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("3번 재료 수량 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientQuantity3 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("4번 재료 식별 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientIdx4 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("4번 재료 수량 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientQuantity4 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("5번 재료 식별 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientIdx5 { get; set; }
|
2024-07-06 12:13:58 +00:00
|
|
|
|
|
|
|
[field: SerializeField, Tooltip("5번 재료 수량 Idx"), BoxGroup("Json 데이터 영역")]
|
2024-07-15 16:20:39 +00:00
|
|
|
public int IngredientQuantity5 { get; set; }
|
|
|
|
|
|
|
|
public List<Ingredient> GetValidIngredients()
|
|
|
|
{
|
|
|
|
var ingredients = new List<Ingredient>(5);
|
|
|
|
|
|
|
|
if (IngredientIdx1 != 0) ingredients.Add(new Ingredient(IngredientIdx1, IngredientQuantity1));
|
|
|
|
if (IngredientIdx2 != 0) ingredients.Add(new Ingredient(IngredientIdx2, IngredientQuantity2));
|
|
|
|
if (IngredientIdx3 != 0) ingredients.Add(new Ingredient(IngredientIdx3, IngredientQuantity3));
|
|
|
|
if (IngredientIdx4 != 0) ingredients.Add(new Ingredient(IngredientIdx4, IngredientQuantity4));
|
|
|
|
if (IngredientIdx5 != 0) ingredients.Add(new Ingredient(IngredientIdx5, IngredientQuantity5));
|
|
|
|
|
|
|
|
return ingredients;
|
|
|
|
}
|
|
|
|
|
|
|
|
public string TasteToString()
|
|
|
|
{
|
|
|
|
switch (Taste)
|
|
|
|
{
|
|
|
|
case FoodTaste.None:
|
|
|
|
return null;
|
|
|
|
case FoodTaste.Savory:
|
|
|
|
return "고소한 맛";
|
|
|
|
case FoodTaste.Spicy:
|
|
|
|
return "매운맛";
|
|
|
|
case FoodTaste.Salty:
|
|
|
|
return "짠맛";
|
|
|
|
case FoodTaste.Sweet:
|
|
|
|
return "단맛";
|
|
|
|
default:
|
|
|
|
throw new ArgumentOutOfRangeException();
|
|
|
|
}
|
|
|
|
}
|
2024-07-06 12:13:58 +00:00
|
|
|
}
|
|
|
|
}
|