//bucket factory. Can build buckets with specific presets public static BucketFlower BuildBucket(BucketTypes BucketType, Flower.FlowerTypes FlowerType = Flower.FlowerTypes.Unused) { BucketFlower ret = new BucketFlower(BucketType, FlowerType); if (BucketType == BucketTypes.Single) { if (FlowerType == Flower.FlowerTypes.Unused) { Console.WriteLine("Invalif flower type!"); return(null); } ret.Add(new Flower(FlowerType)); } else if (BucketType == BucketTypes.Small) { ConfigHandler.EventBucketFactoryUsedConstants(); for (int i = 0; i < 5; i++) { ret.Add(new Flower(Flower.FlowerTypes.Trandafir)); } } else if (BucketType == BucketTypes.Medium) { ConfigHandler.EventBucketFactoryUsedConstants(); for (int i = 0; i < 6; i++) { ret.Add(new Flower(Flower.FlowerTypes.Trandafir)); } for (int i = 0; i < 5; i++) { ret.Add(new Flower(Flower.FlowerTypes.Gladiola)); } } else if (BucketType == BucketTypes.Large) { ConfigHandler.EventBucketFactoryUsedConstants(); for (int i = 0; i < 9; i++) { ret.Add(new Flower(Flower.FlowerTypes.Trandafir)); } for (int i = 0; i < 10; i++) { ret.Add(new Flower(Flower.FlowerTypes.Gladiola)); } for (int i = 0; i < 3; i++) { ret.Add(new Flower(Flower.FlowerTypes.Orhidea)); } } return(ret); }
static void Main(string[] args) { //our sales report keeper SalesReports BookKeeper = new SalesReports(); //make sales for (int i = 0; i < 20; i++) { BucketFlower bf = BucketBuilder.BuildBucket(BucketTypes.Large); BookKeeper.AddSoldBucket(bf); } for (int i = 0; i < 15; i++) { BucketFlower bf = BucketBuilder.BuildBucket(BucketTypes.Medium); BookKeeper.AddSoldBucket(bf); } for (int i = 0; i < 65; i++) { BucketFlower bf = BucketBuilder.BuildBucket(BucketTypes.Small); BookKeeper.AddSoldBucket(bf); } for (int i = 0; i < 20; i++) { BucketFlower bf = BucketBuilder.BuildBucket(BucketTypes.Single, Flower.FlowerTypes.Trandafir); BookKeeper.AddSoldBucket(bf); } for (int i = 0; i < 10; i++) { BucketFlower bf = BucketBuilder.BuildBucket(BucketTypes.Single, Flower.FlowerTypes.Orhidea); BookKeeper.AddSoldBucket(bf); } for (int i = 0; i < 5; i++) { BucketFlower bf = BucketBuilder.BuildBucket(BucketTypes.Single, Flower.FlowerTypes.Gladiola); BookKeeper.AddSoldBucket(bf); } //print out the monthly report BookKeeper.PrintSalesReportShort(); }
//every time we make a sale of a bucket, we should add it here also public void AddSoldBucket(BucketFlower bucket) { Sale sale = new Sale(bucket.GetBucketType(), bucket.GetSubType(), bucket.GetCost()); SalesMade.Add(sale); }