/// <summary> /// Gives the guest a free coupon book. /// </summary> /// <returns>Returns a map.</returns> public Map GiveFreeMap() { Item item = null; try { item = Attendant.FindItem(this.Items, typeof(Map)); } catch (Exception) { throw new MissingItemException("Map not found."); } return(item as Map); }
/// <summary> /// Gives the guest a free coupon book. /// </summary> /// <returns>Returns a coupon book.</returns> public CouponBook GiveFreeCouponBook() { Item item = null; try { item = Attendant.FindItem(this.Items, typeof(CouponBook)); } catch (Exception) { throw new MissingItemException("Couponbook not found."); } return(item as CouponBook); }
/// <summary> /// Sells the guest a water bottle. /// </summary> /// <param name="payment">The payment for the water bottle.</param> /// <returns>Returns a water bottle.</returns> public WaterBottle SellWaterBottle(decimal payment) { Item item = null; try { if (payment == this.WaterBottlePrice) { item = Attendant.FindItem(this.Items, typeof(WaterBottle)); if (item != null) { this.AddMoney(payment); } } } catch (Exception) { throw new MissingItemException("Waterbottle not found."); } return(item as WaterBottle); }