Ejemplo n.º 1
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();
     }
 }
Ejemplo n.º 2
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();
            }
        }
Ejemplo n.º 3
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();
     }
 }
Ejemplo n.º 4
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();
            }
        }
Ejemplo n.º 5
0
    private string GetItemType(I_item item)
    {
        string itemType = null;

        if (item.GetType() == typeof(ArmorGem))
        {
            itemType = "ArmorGem";
        }
        else if (item.GetType() == typeof(WeaponGem))
        {
            itemType = "WeaponGem";
        }
        else if (item.GetType() == typeof(SimplePotion))
        {
            itemType = "SimplePotion";
        }

        return(itemType);
    }