Example #1
0
 private RequestHandler(params IGraphDatabase[] databases)
 {
     Validator = new CityFromValidator();
     Validator.SetNext(new CityToValidator()).SetNext(new MinimalPopulationValidator()).SetNext(new VechicleTypeValidator());
     Solver     = new DFSHandler(new DFS());
     Applicator = new MinPopulationFilterApplicator();
     Applicator.SetNext(new RestaurantRequiredFilterApplicator()).SetNext(new AllowedVehiclesFilterApplicator()).SetNext(new MergeApplicator(databases)).SetNext(new TimeProblemApplicator()).SetNext(new CostProblemApplicator());
     Solver.SetNext(new BFSHandler(new BFS())).SetNext(new DijkstraHandler(new DijkstraCost(), new DijkstraTime()));
 }
 public IApplicator SetNext(IApplicator applicator)
 {
     Next = applicator;
     return(applicator);
 }