Compare commits
No commits in common. "0e7abff08d9f8d8a87296312544ecdaa7cda087d" and "df6465ba4f316e5056430ff5aeb598a2d3c6b600" have entirely different histories.
0e7abff08d
...
df6465ba4f
1
.gitignore
vendored
1
.gitignore
vendored
@ -398,4 +398,3 @@ FodyWeavers.xsd
|
||||
# JetBrains Rider
|
||||
*.sln.iml
|
||||
|
||||
/CarpentryWorkshop/ImplementationExtensions
|
||||
|
@ -63,7 +63,7 @@ namespace CarpentryWorkshopView
|
||||
DataGridView.Rows.Clear();
|
||||
foreach (var wood in _shopWoods)
|
||||
{
|
||||
DataGridView.Rows.Add(new object[] { wood.Key, wood.Value.Item1.WoodName, wood.Value.Item1.Price,wood.Value.Item2 });
|
||||
DataGridView.Rows.Add(new object[] { wood.Key, wood.Value.Item1.WoodName, wood.Value.Item2 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,11 +79,7 @@ namespace CarpentryWorkshopFileImplement.Implements
|
||||
|
||||
public bool CheckAvailability(int woodId, int count)
|
||||
{
|
||||
int minus = source.Shops
|
||||
.SelectMany(shop => shop.ShopWoods
|
||||
.Where(wood => wood.Value.Item1.Id == woodId)
|
||||
.Select(wood => wood.Value.Item2))
|
||||
.Sum();
|
||||
int minus = source.Shops.Select(x => x.ShopWoods.Select(y => (y.Value.Item1.Id == woodId ? y.Value.Item2 : 0)).Sum()).Sum();
|
||||
count -= minus;
|
||||
return count <= 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user