public WalmartForm()
        {
            InitializeComponent();

            // Sets up WalmartStore class
            factory   = new ConcreteFactory();
            inventory = new Inventory();
            finances  = new Finances();
            wm        = new WalmartStore(factory, inventory, finances);


            // Displays the 25 products currently in the inventory
            string[] productsAndCosts = wm.initializeStore();

            for (int i = 0; i < productsAndCosts.Length; i += 2)
            {
                productsLB.Items.Add(productsAndCosts[i]);
                costsLB.Items.Add(productsAndCosts[i + 1]);
            }
        }
Exemplo n.º 2
0
 public WalmartStore(ConcreteFactory factory, Inventory inventory, Finances finances)
 {
     cf = factory;
     i  = inventory;
     f  = finances;
 }