public GrowthRatesPresenter(IKernel k, IGreenhouse g, IGrowthRatesView v)
        {
            kernel = k;
            model  = g;
            view   = v;

            model.tickInfo2 += tickUpdate;
        }
Example #2
0
        public PlanConfigurationPresenter(IKernel kernel, IPlanConfigurationView view,
                                          IGreenhouse model, IPlanConfigurationVerificationService v)
        {
            _kernel       = kernel;
            _view         = view;
            _model        = model;
            _verification = v;

            _view.ConfirmPlan += ConfirmPlan;
        }
        public AddDevicesPresenter(IKernel k, IGreenhouse g, IAddDevicesView v, IAddDevicesVerificationService vs)
        {
            kernel          = k;
            model           = g;
            view            = v;
            ConcreteFactory = new ConcreteFactory();
            verification    = vs;

            //throw new Exception();

            //event subscription
            view.add    += add;
            view.delete += delete;
        }
        public StoreController(IGreenhouse greenhouse, IStore store)
        {
            _greenhouse = greenhouse;
            _store      = store;

            long id1 = _store.AddProduct(new Product {
                Name = "Audi", Price = 3208.7
            });
            long id2 = _store.AddProduct(new Product {
                Name = "Renault", Price = 3605.2
            });
            long id3 = _store.AddProduct(new Product {
                Name = "Saab", Price = 1200.1
            });
        }
        public GreenhousePresenter(IKernel k, IGreenhouse g, IGreenhouseView v,
                                   IGreenhouseVerificationService vs)
        {
            kernel       = k;
            model        = g;
            view         = v;
            verification = vs;

            //event subscription
            view.addDevices        += addDevices;
            view.configurePlan     += configurePlan;
            view.startSimulation   += startSimulation;
            view.showGrowthRates   += showGrowthRates;
            view.saveConfiguration += saveConfiguration;
            view.aAlloc            += acidityAllocation;
            view.lAlloc            += lightAllocation;
            view.tAlloc            += temperatureAllocation;
            view.wAlloc            += wetnessAllocation;

            model.tickInfo += tickUpdate;
        }