public TrendManagementViewModel([Import] IEnergyRepository contextRepository)
        {
            m_Repository = contextRepository;
            m_Repository.ContextChanged += (s, e) => Application.Current.Dispatcher.Invoke(Reload);

            Reload();
        }
 public HarvesterController(IEnergyRepository energyRepository, IHarvesterFactory harvesterFactory)
 {
     this.harvesters       = new List <IHarvester>();
     this.energyRepository = energyRepository;
     this.harvesterFactory = harvesterFactory;
     this.mode             = DefaultMode;
 }
Example #3
0
 public HarvesterController(IEnergyRepository energyRepository, IHarvesterFactory factory)
 {
     this.energyRepository = energyRepository;
     this.factory          = factory;
     this.mode             = Constants.DefaultHarvesterMode;
     this.harvesters       = new List <IHarvester>();
 }
 public HarvesterController(IEnergyRepository energyRepository)
 {
     this.mode             = "Full";
     this.harvesters       = new List <IHarvester>();
     this.energyRepository = energyRepository;
     this.factory          = new HarvesterFactory();
 }
 public HarvesterController(IEnergyRepository energyRepository)
 {
     this.harvesters       = new List <IHarvester>();
     this.harvesterFactory = new HarvesterFactory();
     this.workMode         = WorkMode.Full;
     this.energyRepository = energyRepository;
 }
Example #6
0
 public HarvesterController(IEnergyRepository energyRepository)
 {
     this.energyRepository = energyRepository;
     this.harvesters       = new List <IHarvester>();
     this.TotalOreProduced = Constants.InitialOreQuantity;
     this.harvesterFactory = new HarvesterFactory();
 }
Example #7
0
 public HarvesterController(IEnergyRepository energyRepository)
 {
     this.energyRepository = energyRepository;
     this.Mode             = InitialMode;
     this.harvesters       = new List <IHarvester>();
     this.factory          = new HarvesterFactory();
 }
Example #8
0
    public void ProducesCorrectAmountOfEnergy()
    {
        this.energyRepository   = new EnergyRepository();
        this.providerController = new ProviderController(energyRepository);

        List <string> provider1 = new List <string>()
        {
            "Solar",
            "1",
            "100"
        };

        List <string> provider2 = new List <string>()
        {
            "Solar",
            "2",
            "100"
        };

        providerController.Register(provider1);
        providerController.Register(provider2);


        this.providerController.Produce();

        Assert.AreEqual(200, providerController.TotalEnergyProduced);
    }
Example #9
0
 public ConsumerGroupModifyViewModel(ConsumerGroup model, [Import] IEnergyRepository consumerRepository, [Import] IEnergyViewModelFactory energyViewModelFactory)
 {
     m_Repository             = consumerRepository;
     DisplayName              = "Verbrauchergruppe bearbeiten...";
     m_EnergyViewModelFactory = energyViewModelFactory;
     m_Model = model;
 }
    public HarvesterController(IEnergyRepository energyRepository)
    {
        this.energyRepository = energyRepository;
        this.harvesters       = new List <IHarvester>();

        this.mode = WorkingMode.Full;
    }
 public HarvesterController(IEnergyRepository energyRepository)
 {
     this.EnergyRepository = energyRepository;
     this.harvesters = new List<IHarvester>();
     this.factory = new HarvesterFactory();
     this.EnergyRepository.TakeEnergy(this.harvesters.Select(h => h.EnergyRequirement).Sum());
 }
 public HarvesterController(IHarvesterFactory factory, IEnergyRepository energyRepository, List <IHarvester> harvesters)
 {
     this.mode             = ModeConst;
     this.oreProduced      = 0;
     this.factory          = factory;
     this.energyRepository = energyRepository;
     this.harvesters       = harvesters;
 }
Example #13
0
    public void SetProviderController()
    {
        this.providerFactory  = new ProviderFactory();
        this.energyRepository = new EnergyRepository();
        this.providers        = new List <IProvider>();

        this.providerController = new ProviderController(energyRepository, providers, providerFactory);
    }
        public MeasureViewModelFactory([Import] IEnergyRepository energyRepository, [Import] IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory,
                                       [Import] IViewModelFactory subMeasureViewModelFactory)
        {
            m_MeasureRepository = energyRepository;
            m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;

            m_SubMeasureViewModelFactory = subMeasureViewModelFactory;
        }
    public HarvesterController(IEnergyRepository energyRepository, IHarvesterFactory factory)
    {
        this.energyRepository = energyRepository;
        this.factory          = factory;

        this.harvesters = new List <IHarvester>();
        this.Mode       = HarvestMode.Full;
    }
Example #16
0
 public HarvesterController(IEnergyRepository energyRepository)
 {
     this.harversterFactory = new HarvesterFactory();
     this.harvesters        = new List <IHarvester>();
     this.energyRepository  = new EnergyRepository();
     this.oreOutput         = 0;
     this.currentMode       = FullMode;
 }
 public DistributorModifyViewModel(Distributor model, [Import] IEnergyRepository consumerRepository, [Import] IEnergyViewModelFactory energyViewModelFactory)
 {
     DisplayName = "Verteiler bearbeiten...";
     m_Model     = model;
     m_EnergyViewModelFactory = energyViewModelFactory;
     m_Repository             = consumerRepository;
     ReadingAddVm             = new ReadingAddViewModel();
 }
Example #18
0
 public ConsumerModifyViewModel(Consumer consumer, [Import] IEnergyRepository consumerRepository, [Import] IEnergyViewModelFactory energyViewModelFactory)
 {
     DisplayName              = "Verbraucher bearbeiten...";
     m_Model                  = consumer;
     m_Repository             = consumerRepository;
     m_EnergyViewModelFactory = energyViewModelFactory;
     ReadingAddVm             = new ReadingAddViewModel();
 }
 public HarvesterController(IEnergyRepository energyRepository)
 {
     this.energyRepository = energyRepository;
     this.harvesters       = new List <IHarvester>();
     this.harvesterFactory = new HarvesterFactory();
     this.mode             = FullMode;
     this.TotalOreProduced = 0;
 }
Example #20
0
 public HarvesterController(IEnergyRepository energyRepository)
 {
     this.harvesterFactory = new HarvesterFactory();
     this.energyRepository = energyRepository;
     this.allHarvesters    = new List <IHarvester>();
     this.oreProduced      = 0;
     this.currentMode      = FullMode;
 }
 public HarvesterController(IEnergyRepository energyRepository, IList <IHarvester> harvesters, IHarvesterFactory harvesterFactory)
 {
     this.energyRepository = energyRepository;
     this.harvesters       = harvesters;
     this.factory          = harvesterFactory;
     this.mode             = "Full";
     this.OreProduced      = 0;
 }
 public HarvesterController(IEnergyRepository energyRepository)
 {
     currentMode           = (Mode)Enum.Parse(typeof(Mode), Constants.DefaultMode, true);
     harvesters            = new List <IHarvester>();
     harvesterFactory      = new HarvesterFactory();
     OreProduced           = 0;
     this.energyRepository = energyRepository;
 }
Example #23
0
        public EnergyManagementViewModel([Import] IEnergyRepository mRepository, [Import] IEnergyViewModelFactory mEnergyViewModelFactory, [Import] IDialogManager dialogs)
        {
            Dialogs                  = dialogs;
            m_Repository             = mRepository;
            m_EnergyViewModelFactory = mEnergyViewModelFactory;

            m_Repository.ContextChanged += (s, e) => Application.Current.Dispatcher.Invoke(Reload);
            Reload();
        }
Example #24
0
 public DraftManager()
 {
     this.mode              = Modes.FullMode;
     this.totalMinedOre     = 0;
     this.totalStoredEnergy = 0;
     this.energyRepository  = new EnergyRepository();
     this.harvesterFactory  = new HarvesterFactory();
     this.providerFactory   = new ProviderFactory();
 }
 public HarvesterController(
     List <IHarvester> harvesters,
     IHarvesterFactory factory,
     IEnergyRepository energyRepository)
 {
     this.mode             = "Full";
     this.harvesters       = harvesters;
     this.factory          = factory;
     this.energyRepository = energyRepository;
 }
 public HarvesterController(
     IHarvesterFactory harvesterFactory,
     IEnergyRepository energyRepository)
 {
     this.harvesterFactory = harvesterFactory;
     this.energyRepository = energyRepository;
     this.workMode         = WorkMode.Full;
     this.OreProduced      = 0;
     this.harvesters       = new List <IHarvester>();
 }
Example #27
0
    public ProviderController(
        IEnergyRepository energyRepository,
        IList <IProvider> providers,
        IProviderFactory factory)
    {
        this.energyRepository = energyRepository;
        this.providers        = providers;
        this.factory          = factory;

        this.TotalEnergyProduced = 0;
    }
        public MeasureManagementViewModel([Import] IEnergyRepository contextRepository, [Import] IMeasureViewModelFactory measureViewModelFactory, [Import] IEnergyViewModelFactory energyViewModelFactory)
        {
            m_Repository = contextRepository;
            m_MeasureViewModelFactory = measureViewModelFactory;
            m_EnergyViewModelFactory  = energyViewModelFactory;

            m_Repository.ContextChanged += (s, e) => Application.Current.Dispatcher.Invoke(Reload);

            Reload();

            FlyoutActivated = true;
        }
 public HarvesterController(
     IEnergyRepository energyRepository,
     IList <IHarvester> harvesters,
     IHarvesterFactory factory,
     string mode)
 {
     this.energyRepository = energyRepository;
     this.harvesters       = harvesters;
     this.factory          = factory;
     this.mode             = mode;
     this.OreProduced      = 0;
 }
Example #30
0
    public CommandInterpreter(IEnergyRepository energyRepository,
                              IHarvesterController harvesterController,
                              IProviderController providerController,
                              List <IHarvester> harvesters,
                              List <IProvider> providers)
    {
        this.energyRepository    = energyRepository;
        this.ProviderController  = providerController;
        this.HarvesterController = harvesterController;

        this.harvesters = harvesters;
        this.providers  = providers;
    }