Beispiel #1
0
 /// <summary>
 ///		Makes backroom create a product and adds it to _productsForSale
 /// </summary>
 /// <param name="numberOfDecorations">
 ///		number of times a random decoration should be added to the statue
 /// </param>
 private void RecieveProductsForSaleFromBackroom(int numberOfDecorations)
 {
     if (ProductsForSale.Count + ProductsSold.Count < Quota)
     {
         var result = Backroom.CreateProduct(numberOfDecorations);
         ProductsForSale.Add(result);
     }
 }
Beispiel #2
0
 /// <summary>
 ///		Constructor
 /// </summary>
 /// <param name="quota">
 ///		Sets the quota for product to be made for each backroom
 /// </param>
 /// <param name="typeOfShop">
 ///		Enum of types of shop to be created.
 /// </param>
 public Store(int quota, ShopType typeOfShop)
 {
     Quota           = quota;
     Shop            = ShopFactory.ShopFactory.CreateShop(typeOfShop);
     Name            = Shop.GetName();
     Backroom        = new Backroom();
     ProductsForSale = Backroom.CreateMultipleStatues(5);
     ProductsSold    = new List <IStatue>();
     StoreIsOpen     = true;
 }