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(); } }
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(); } }
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(); } }
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(); } }
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); }