Пример #1
0
 public void Add(Presents present)
 {
     if (Capacity > Count)
     {
         data.Add(present);
     }
 }
Пример #2
0
        public Presents GetPresent(string name)
        {
            Presents currentPresent = data.FirstOrDefault(x => x.Name == name);

            return(currentPresent);
        }
Пример #3
0
        public Presents GetHeaviestPresents()
        {
            Presents heaviestPresents = data.OrderByDescending(x => x.Weight).FirstOrDefault();

            return(heaviestPresents);
        }
Пример #4
0
        public bool Remove(string name)
        {
            Presents present = data.FirstOrDefault(x => x.Name == name);

            return(data.Remove(present));
        }