Ejemplo n.º 1
0
 public bool isValid(Backpack pack) => pack.TotalWeight <= _maxWeight;
Ejemplo n.º 2
0
 private void printPack(string info, Backpack pack)
 {
     Console.WriteLine(info + $"{itemsPresentation()} \n" +
                       $"{string.Join("\t  ", pack.Presentation(_baseItems))}" + $"\t TotalWeight - {pack.TotalWeight}, " + $"TotalWorth - {pack.TotalWorth}");
 }
Ejemplo n.º 3
0
 public static IEnumerable <int> Presentation(this Backpack pack, List <Item> items) =>
 items.Select(x => pack.Items.Contains(x) ? 1 : 0);