небольшой фикс

This commit is contained in:
Павел Сорокин 2023-03-14 13:13:41 +04:00
parent 3c775f32fb
commit fec3e7d1ef

View File

@ -86,7 +86,8 @@ namespace ShipyardFileImplement.Implements
}
public bool SellShips(IShipModel model, int count)
{
if (source.Shops.Select(x => x.Ships.FirstOrDefault(y => y.Key == model.Id).Value.Item2).Sum()<count)
int availableQuantity = source.Shops.Select(x => x.Ships.FirstOrDefault(y => y.Key == model.Id).Value.Item2).Sum();
if (availableQuantity < count)
{
return false;
}