Exemplo n.º 1
0
 public override void AddOnSelectedPosition(I_item Item, int position)
 {
     if ((Item.GetType() == typeof(Person) && TotalWeight + Item.GetWeight() <= MaxWeight) && Items[position] == null)
     {
         Items[position] = Item;
         TotalWeight    += Item.GetWeight();
     }
 }
Exemplo n.º 2
0
        public override void AddOnEmptySpot(I_item Item)
        {
            double ComparableWeight = GetWeight() + Item.GetWeight();

            if ((Item.GetType() == typeof(Person) && ComparableWeight <= MaxWeight))
            {
                Items.Add(Item);
                TotalWeight += Item.GetWeight();
            }
        }
Exemplo n.º 3
0
        public override void AddOnEmptySpot(I_item Item)
        {
            double ComparableWeight = GetWeight() + Item.GetWeight();

            if ((Item.GetType() == typeof(Container) || (Item.GetType() == typeof(Package)) && ComparableWeight <= TotalWeight))
            {
                Items.Add(Item);
                TotalWeight += Item.GetWeight();
            }
        }
Exemplo n.º 4
0
 public override void AddOnSelectedPosition(I_item Item, int position)
 {
     if ((Item.GetType() == typeof(Container) || (Item.GetType() == typeof(Package)) && TotalWeight + Item.GetWeight() <= TotalWeight) && Items[position] == null)
     {
         Items[position] = Item;
         TotalWeight    += Item.GetWeight();
     }
 }