public SelectedProblemProvider(IUserInputProvider inputProvider, ISolverProvider solverProvider, IConfigurationValueProvider provider, SolvedConfigurationProvider solvedConfigurationProvider)
 {
     _inputProvider               = inputProvider;
     _configurationProvider       = provider;
     _solvedConfigurationProvider = solvedConfigurationProvider;
     _solverProvider              = solverProvider;
 }
Пример #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="solversPath"></param>
        /// <param name="parentWindow"></param>
        public SolversManager(ISolverProvider solverProvider, Window parentWindow)
        {
            if (solversPath == null) throw new InvalidStateException("Function Initialize must be called before creating an instance of SolversManager.");

            solversDictionary = new Dictionary<string, SolverLibrary>();
            this.parentWindow = parentWindow;
            this.solverProvider = solverProvider;
            loadSolverPlugins(solversPath);

            solvingThread.DoWork += new DoWorkEventHandler(solvingThread_DoWork);
            solvingThread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(solvingThread_RunWorkerCompleted);
        }
Пример #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="path">Absolute path to the directory with solvers</param>
        /// <param name="parentWindow">We need to display dialogs and the dialogs need to be bound to a window; main window reference is expected</param>
        public void Initialize(ISolverProvider solverProvider, Window parentWindow, 
            IErrorMessagesPresenter errorPresenter, IUserInquirer userInquirer, IGameServerCommunication gameServerCommunication)
        {
            this.errorPresenter = errorPresenter;
            this.gameServerCommunication = gameServerCommunication;
            this.userInquirer = userInquirer;
            this.solverProvider = solverProvider;
            solversManager = new SolversManager(solverProvider, parentWindow);
            // Register callback
            solversManager.RegisterStatusChangeCallback(solverStatusChange);
            SolversList = new ObservableCollection<string>(solversManager.Solvers); // we want to notify
            CurrentSolver = solversManager.CurrentSolver;

            solverPainter = solverProvider as ISolverPainter;

            if (solverPainter == null)
            {
                throw new Exception("Reference `solverProvider' should also implement ISolverPainter.");
            }
        }
Пример #4
0
 public SolutionSender(IServerAdapter server, ISolverProvider solverProvider, ISolversTestGenerator testGenerator)
 {
     _server         = server;
     _solverProvider = solverProvider;
     _testGenerator  = testGenerator;
 }