112 lines
2.3 KiB
C#
112 lines
2.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
public enum ItemCategory
|
|
{
|
|
Material = 1,
|
|
Recipe = 2,
|
|
Pan = 3,
|
|
}
|
|
|
|
public enum ShopItemType
|
|
{
|
|
Consumable = 1,
|
|
NonConsumable = 2,
|
|
}
|
|
|
|
public enum ProductRarity
|
|
{
|
|
Normal = 1,
|
|
Yellow = 2,
|
|
Copper = 3,
|
|
Silver = 4,
|
|
Gold = 5,
|
|
Rainbow = 6,
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class RarityData
|
|
{
|
|
public int id;
|
|
public int rate;
|
|
public int bulkOrderBonus;
|
|
public ProductRarity Rarity => (ProductRarity)id;
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class PanData
|
|
{
|
|
public int id;
|
|
public int nameId;
|
|
public string name;
|
|
public string text;
|
|
public int rarity;
|
|
public ProductRarity Rarity => (ProductRarity)rarity;
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class ProductData
|
|
{
|
|
public int id;
|
|
public int nameId;
|
|
public string name;
|
|
public int shopLevel;
|
|
public int price;
|
|
public int volume;
|
|
public int material1Id;
|
|
public int material2Id;
|
|
public int material3Id;
|
|
// public int cookingType;
|
|
public string prefabName;
|
|
public string productPrefabName;
|
|
private List<(int id, int amount)> materialList;
|
|
public List<(int id, int amount)> MaterialList
|
|
{
|
|
get
|
|
{
|
|
if (materialList == null)
|
|
{
|
|
materialList = new List<(int id, int amount)>
|
|
{
|
|
(material1Id,15 * volume),
|
|
(material2Id,1),
|
|
(material3Id,1),
|
|
};
|
|
}
|
|
return materialList;
|
|
}
|
|
}
|
|
|
|
public int GetMaterialCount()
|
|
{
|
|
return materialList.Count(material => material.id != Const.NotSetMaterialId);
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class ShopLevelData
|
|
{
|
|
public int id;
|
|
public int shopLevel;
|
|
public int heart;
|
|
public int customer;
|
|
public int achievement;
|
|
public string text;
|
|
}
|
|
|
|
[Serializable]
|
|
public sealed class ShopData {
|
|
public int id;
|
|
public int nameId;
|
|
public int itemId;
|
|
public string name;
|
|
public int price;
|
|
public string text;
|
|
public int category;
|
|
public int consumeType;
|
|
public string prefabName;
|
|
public ItemCategory Category => (ItemCategory)category;
|
|
public ShopItemType ConsumeType => (ShopItemType)consumeType;
|
|
} |