81 lines
3.2 KiB
C#
81 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BlueWater.Interfaces;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Items
|
|
{
|
|
public enum DrinkCategory
|
|
{
|
|
None = 0,
|
|
Alcohol,
|
|
Garnish
|
|
}
|
|
|
|
[Serializable]
|
|
public class DrinkData : IIdx
|
|
{
|
|
[BoxGroup("Json 데이터 영역")]
|
|
[field: SerializeField, Tooltip("고유 식별 ID"), BoxGroup("Json 데이터 영역")]
|
|
public string Idx { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("이름"), BoxGroup("Json 데이터 영역")]
|
|
public string Name { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("종류"), BoxGroup("Json 데이터 영역")]
|
|
public DrinkCategory Category { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("총량"), BoxGroup("Json 데이터 영역")]
|
|
public int Amount { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("도수"), BoxGroup("Json 데이터 영역")]
|
|
public int AlcoholVolume { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("온도"), BoxGroup("Json 데이터 영역")]
|
|
public int CoolWarm { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("맛"), BoxGroup("Json 데이터 영역")]
|
|
public int BitterSweet { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("향"), BoxGroup("Json 데이터 영역")]
|
|
public int Scent { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("1번 재료 식별 Idx"), BoxGroup("Json 데이터 영역")]
|
|
public string IngredientIdx1 { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("1번 재료 수량 Idx"), BoxGroup("Json 데이터 영역")]
|
|
public int IngredientQuantity1 { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("2번 재료 식별 Idx"), BoxGroup("Json 데이터 영역")]
|
|
public string IngredientIdx2 { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("2번 재료 수량 Idx"), BoxGroup("Json 데이터 영역")]
|
|
public int IngredientQuantity2 { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("3번 재료 식별 Idx"), BoxGroup("Json 데이터 영역")]
|
|
public string IngredientIdx3 { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("3번 재료 수량 Idx"), BoxGroup("Json 데이터 영역")]
|
|
public int IngredientQuantity3 { get; set; }
|
|
|
|
[BoxGroup("직접 추가하는 영역")]
|
|
[field: SerializeField, BoxGroup("직접 추가하는 영역")]
|
|
public Sprite Sprite { get; set; }
|
|
|
|
[BoxGroup("직접 추가하는 영역")]
|
|
[field: SerializeField, BoxGroup("직접 추가하는 영역")]
|
|
public Color Color { get; set; }
|
|
|
|
public List<Ingredient> GetValidIngredients()
|
|
{
|
|
var ingredients = new List<Ingredient>(3);
|
|
|
|
if (!string.IsNullOrEmpty(IngredientIdx1)) ingredients.Add(new Ingredient(IngredientIdx1, IngredientQuantity1));
|
|
if (!string.IsNullOrEmpty(IngredientIdx2)) ingredients.Add(new Ingredient(IngredientIdx2, IngredientQuantity2));
|
|
if (!string.IsNullOrEmpty(IngredientIdx3)) ingredients.Add(new Ingredient(IngredientIdx3, IngredientQuantity3));
|
|
|
|
return ingredients;
|
|
}
|
|
}
|
|
} |