コード例 #1
0
        public Controller(ProblemDescription problem)
        {
            if (problem.Solver is HohmannSolver)
            {
                vm = new HohmannsEngine(117, problem.ScenarioNumber);
            }
            else if (problem.Solver is MeetAndGreetSolver)
            {
                vm = new MeetAndGreetEngine(117, problem.ScenarioNumber, problem.ScenarioNumber);
            }
            else if (problem.Solver is EccentricMeetAndGreetSolver)
            {
                vm = new EccentricMeetAndGreetEngine(117, problem.ScenarioNumber);
            }
            else
            {
                throw new ArgumentException("неизвестный солвер!");
            }

            solverDriver     = new Driver(problem.Solver);
            simulationThread = new Thread(Simulate)
            {
                Name = "Симулятор", IsBackground = true
            };
            simulationThread.Start();
        }
コード例 #2
0
ファイル: Controller.cs プロジェクト: dharco/all-my-circuirs
		public Controller(ProblemDescription problem)
		{
			if (problem.Solver is HohmannSolver)
				vm = new HohmannsEngine(117, problem.ScenarioNumber);
			else if(problem.Solver is MeetAndGreetSolver)
				vm = new MeetAndGreetEngine(117, problem.ScenarioNumber, problem.ScenarioNumber);
			else if(problem.Solver is EccentricMeetAndGreetSolver)
				vm = new EccentricMeetAndGreetEngine(117, problem.ScenarioNumber);
			else 
				throw new ArgumentException("неизвестный солвер!");

			solverDriver = new Driver(problem.Solver);
			simulationThread = new Thread(Simulate) { Name = "Симулятор", IsBackground  = true }; 
      simulationThread.Start();
		}