RecipeDataクラス削除

This commit is contained in:
kimura 2022-05-18 17:44:31 +09:00
parent 150cb96281
commit 08b7f31ce7
3 changed files with 6 additions and 37 deletions

View File

@ -608,10 +608,13 @@ public class Market : SingletonMonoBehaviour<Market>
public static void StockFlavorLog() public static void StockFlavorLog()
{ {
var shopStockString = ""; var shopStockString = "";
foreach (var data in RecipeData.GetAllRecipe()) shopStockString += $@"tank count:{GameDataManager.GameData.StorageTanks.Count}
tank {GameDataManager.GameData.StorageTanks.Aggregate("", (s, tank) => $"{s}, flavor:{tank.FlavorId}({tank.Stock})")}
";
foreach (var data in SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet))
{ {
var shopStockCount = GameDataManager.GameData.ShopStock.FindAll(x => x.FlavorId == data.RecipeId).Count; var shopStockCount = GameDataManager.GameData.ShopStock.FindAll(x => x.FlavorId == data.id).Count;
var tank = GameDataManager.GameData.StorageTanks.FindAll(x => x.FlavorId == data.RecipeId).Sum(x => x.Stock); var tank = GameDataManager.GameData.StorageTanks.FindAll(x => x.FlavorId == data.id).Sum(x => x.Stock);
if (shopStockCount + tank == 0) if (shopStockCount + tank == 0)
{ {
continue; continue;

View File

@ -1,31 +0,0 @@
using System.Collections.Generic;
using System.Linq;
public class RecipeData
{
public int RecipeId;
public string Name;
public int Price;
// public string IconSprite;
public int Volume;
public int CornAmount;
public List<(int id, int amount)> Flavors;
public static RecipeData GetRecipe(int flavorId)
{
return GetAllRecipe().FirstOrDefault(x => x.RecipeId == flavorId);
}
public static List<RecipeData> GetAllRecipe()
{
return SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet).Select(data => new RecipeData
{
RecipeId = data.id,
Name = data.Name,
Price = data.price,
Volume = data.volume,
CornAmount = data.MaterialList[0].amount,
Flavors = data.MaterialList
}).ToList();
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 5193219b46d047b595b22809e43804a1
timeCreated: 1628058980