public Merchant(int merchantId, MallController controller) { if (controller == null) { throw new ArgumentException("controller"); } _merchantId = merchantId; _controller = controller; }
/// <summary> /// Initializes a new instance of the <see cref="ZyGames.Framework.Game.Com.Mall.Merchant"/> class. /// </summary> /// <param name="merchantId">Merchant identifier.</param> /// <param name="controller">Controller.</param> public Merchant(int merchantId, MallController controller) { if (controller == null) { throw new ArgumentException("controller"); } _merchantId = merchantId; _controller = controller; }
/// <summary> /// Registers the merchant. /// </summary> /// <param name="merchantId">Merchant identifier.</param> /// <param name="controller">Controller.</param> public static void RegisterMerchant(int merchantId, MallController controller) { if (controller == null) { throw new ArgumentNullException("controller"); } Merchant merchant = new Merchant(merchantId, controller); merchant.InitializeGoods(); if (!_merchantList.ContainsKey(merchantId)) { _merchantList.Add(merchantId, merchant); } }
public static void RegisterMerchant(int merchantId, MallController controller) { if (controller == null) { throw new ArgumentNullException("controller"); } Merchant merchant = new Merchant(merchantId, controller); merchant.InitializeGoods(); if (!_merchantList.ContainsKey(merchantId)) { _merchantList.Add(merchantId, merchant); } }