レシピデータ修正/ポップコーン追加処理修正

This commit is contained in:
kimura 2021-09-22 15:08:20 +09:00
parent 9b724cf874
commit 9c7980820c
2 changed files with 10 additions and 7 deletions

View File

@ -106,10 +106,13 @@ public class CookingResult : MonoBehaviour
gameData.ShopStock.AddRange(Enumerable.Repeat(recipe.RecipeId, stockCount)); gameData.ShopStock.AddRange(Enumerable.Repeat(recipe.RecipeId, stockCount));
remain -= stockCount; remain -= stockCount;
// 空タンク並び替え
gameData.StorageTanks = gameData.StorageTanks.OrderBy(tank => tank.IsEmpty).ToList();
// 空きのタンクを確認 // 空きのタンクを確認
gameData.StorageTanks gameData.StorageTanks
.Where(tank => tank.IsEmpty || tank.FlavorId == recipe.RecipeId && !tank.IsFull) .Select((tank, i) => (tank, i))
.Select((tank, i) => (i, space: tank.Capacity - tank.Stock)) .Where(x => x.tank.IsEmpty || x.tank.FlavorId == recipe.RecipeId && !x.tank.IsFull)
.Select(x => (x.i, space: x.tank.Capacity - x.tank.Stock))
.OrderBy(x => x.space) .OrderBy(x => x.space)
.ToList() .ToList()
.ForEach(x => .ForEach(x =>

View File

@ -29,7 +29,7 @@ public class RecipeData
CornAmount = 150, CornAmount = 150,
Flavors = new List<(int id, int amount)> Flavors = new List<(int id, int amount)>
{ {
(1, 1) (2, 1)
} }
}, },
new RecipeData new RecipeData
@ -41,7 +41,7 @@ public class RecipeData
CornAmount = 150, CornAmount = 150,
Flavors = new List<(int id, int amount)> Flavors = new List<(int id, int amount)>
{ {
(6, 1) (7, 1)
} }
}, },
new RecipeData new RecipeData
@ -53,7 +53,7 @@ public class RecipeData
CornAmount = 150, CornAmount = 150,
Flavors = new List<(int id, int amount)> Flavors = new List<(int id, int amount)>
{ {
(2, 1) (3, 1)
} }
}, },
new RecipeData new RecipeData
@ -65,8 +65,8 @@ public class RecipeData
CornAmount = 150, CornAmount = 150,
Flavors = new List<(int id, int amount)> Flavors = new List<(int id, int amount)>
{ {
(1, 1), (2, 1),
(6, 1), (7, 1),
} }
}, },
}; };