Ejemplo n.º 1
0
 public SettingsPageModel()
 {
     _robotService   = FreshIOC.Container.Resolve <IRobotService>();
     _barmanService  = FreshIOC.Container.Resolve <IBarmanService>();
     _agvService     = FreshIOC.Container.Resolve <IAgvService>();
     _isRobotInRelax = true;
 }
 public DownloadCardSWDestinyDBController(IRequestService requestService, IStatusService statusService,
                                          IRobotService robotService, ISiteService siteService,
                                          IDownloadCardSWDestinyDBExecutor executor) : base(requestService, statusService,
                                                                                            robotService, siteService, executor)
 {
     _robotService = robotService;
     _siteService  = siteService;
 }
Ejemplo n.º 3
0
 public CrawlerBaseController(IRequestService requestService,
                              IStatusService statusService, IRobotService robotService,
                              ISiteService siteService, ICrawlerBaseExecutor executor)
 {
     _requestService = requestService;
     _statusService  = statusService;
     _robotService   = robotService;
     _siteService    = siteService;
     _executor       = executor;
 }
Ejemplo n.º 4
0
 public RobotController(
     IRobotService robotService,
     IBackgroundJobClient client,
     IUserService userService,
     IMapper mapper) : base(mapper)
 {
     _robotService = robotService;
     _userService  = userService;
     _client       = client;
 }
Ejemplo n.º 5
0
        public BarmanService()
        {
            _robotService      = FreshIOC.Container.Resolve <IRobotService>();
            _databaseService   = FreshIOC.Container.Resolve <IJsonDatabaseService>();
            _bottleTokenSource = new CancellationTokenSource();
            _agvTokenSource    = new CancellationTokenSource();

            Speed          = 60;
            SelectedBottle = new DrinksPageItem
            {
                DrinkPosition = DrinkPosition.First
            };

            BaseCupPosition = _databaseService.GetBaseCupPosition();
        }
        public RobotQueries(IRobotService robotService)
        {
            FieldAsync <ListRobotsQueryModelType>(
                SEARCH_REQUEST_ENDPOINT,
                "Returns a paginated list of Robots",
                new QueryArguments(
                    new QueryArgument <NonNullGraphType <PagedRequestType> > {
                Name = PAGINATION_ARGUMENT_NAME, Description = PagedRequestType.Description
            },
                    new QueryArgument <NonNullGraphType <OrderedRequestType> > {
                Name = ORDERING_ARGUMENT_NAME, Description = OrderedRequestType.Description
            },
                    new QueryArgument <NonNullGraphType <FilteredRequestType <Robot> > > {
                Name = FILTERING_ARGUMENT_NAME, Description = FilteredRequestType <Robot> .Description
            }
                    ),
                async context =>
            {
                var pagination = context.GetArgument <Pagination>(PAGINATION_ARGUMENT_NAME);
                var ordering   = context.GetArgument <Ordering>(ORDERING_ARGUMENT_NAME);
                var filtering  = context.GetArgument <RobotFilter>(FILTERING_ARGUMENT_NAME);

                var(totalCount, items) = await robotService.SearchRobotAsync(pagination, ordering, filtering);
                try
                {
                    return(new ListResponse <Robot>
                    {
                        TotalCount = totalCount,
                        Items = items
                    });
                }
                catch (Exception)
                {
                    context.Errors.Add(new ExecutionError("Server Error"));
                    return(null);
                }
            }
                );
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Reads the command input from a user and decides which action to take
        /// </summary>
        /// <param name="boardName"></param>
        /// <param name="robotService"></param>
        /// <returns></returns>
        private static Action ReadCommand(string boardName, IRobotService robotService)
        {
            var command = Console.ReadLine().ToLower();

            switch (command)
            {
            case string comm when comm.Contains("place"):
                var commandVariables = command.Substring(6, command.Length - 6);

                var variables = commandVariables.Split(',');
                if (variables.Length != 3)
                {
                    break;
                }

                var xSuccess = int.TryParse(variables[0], out var x);
                var ySuccess = int.TryParse(variables[1], out var y);
                var fSuccess = Enum.TryParse <Direction>(variables[2].ToUpper(), out var direction);

                if (!xSuccess || !ySuccess || !fSuccess)
                {
                    break;
                }
                return(() => robotService.PlaceRobot(boardName, new Vector2(x, y), direction));

            case "move":
                return(() => robotService.MoveForward(boardName));

            case "left":
                return(() => robotService.Rotate(boardName, RotateDirection.LEFT));

            case "right":
                return(() => robotService.Rotate(boardName, RotateDirection.RIGHT));

            case "report":
                return(() => { Console.WriteLine(robotService.ReportPosition(boardName)); });
            }
            return(() => Console.WriteLine("Invalid input please try again"));
        }
Ejemplo n.º 8
0
 public DataInitializer(IRobotService robotService)
 {
     _robotService = robotService;
 }
Ejemplo n.º 9
0
 public WarService(IRobotService robotService)
 {
     _robotService = robotService;
 }
Ejemplo n.º 10
0
 public BindRobotHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
 public RobotController(IRobotService robotService)
 {
     this.robotService = robotService;
 }
Ejemplo n.º 12
0
        /* It's always good practice to code against the interface. It allows us to test our code properly because we can mock the interfaces.
         * I am proposing that we use Dependency Injection pattern. As already mentioned above, our code will be more testable. We also going to achieve a more readability
         * along side that, our code can also be reusable
         * With Dependency Injection, we don't have to instatiate the services on the constructors, the IoC takes car of that. we can pass everything as interface.
         *
         * I would also have a factory pattern to get the Parts for either Robot or Car. This would help us clean this class a little bit more because we'd remove the last two
         * methods GetRobotPartsFor and only use the service to get the parts
         */

        public Factory(IRobotService robotService, IPartsService partsService, ICarService carService)
        {
            _robotService = robotService;
            _partsService = partsService;
            _carService   = carService;
        }
 public RobotController(IRobotService robotService, IMapper mapper)
 {
     _robotService = robotService;
     _mapper       = mapper;
 }
Ejemplo n.º 14
0
 public RobotController(HelpersManager helperManager, IRobotService robotService, IHubContext <NotificationHub> notificationHub)
 {
     _helpersManager  = helperManager;
     _robotService    = robotService;
     _notificationHub = notificationHub;
 }
Ejemplo n.º 15
0
 public RefreshRobotCacheFilter(HelpersManager helpersManager, IRobotService robotService)
 {
     _helpersManager = helpersManager;
     _robotService   = robotService;
 }
Ejemplo n.º 16
0
 public RobotsController(IRobotService service, ILogger <RobotsController> logger)
 {
     _service = service;
     _logger  = logger;
 }
Ejemplo n.º 17
0
 public BattleService(IRobotService robotService, ICyborgService cyborgService)
 {
     _robotService    = robotService;
     _cyborgService   = cyborgService;
     _randomGenerator = new Random();
 }
Ejemplo n.º 18
0
 public void SetupTests()
 {
     _mockCache = new Mock <ICacheService>();
     _mockCache.Setup(x => x.Get <Robot>(It.IsAny <string>())).Returns(new Robot());
     _robotService = new RobotService(_mockCache.Object);
 }
Ejemplo n.º 19
0
 public RobotController(IMapper mapper, IRobotService robotService)
 {
     _mapper       = mapper;
     _robotService = robotService;
 }
Ejemplo n.º 20
0
 public DriveHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
Ejemplo n.º 21
0
 public HomeController(IRobotService robotService)
 {
     _robotService = robotService;
 }
 public BrowseAvailableRobotsHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
 public RobotsUpdateRequestProcess(IRobotService robotService, ILogger <RobotsUpdateRequestProcess> logger)
 {
     m_robotService = robotService;
     m_logger       = logger;
 }
Ejemplo n.º 24
0
 public AdminsController(IAdminService adminService, IRobotService robotService)
 {
     this.adminService = adminService;
     this.robotService = robotService;
 }
Ejemplo n.º 25
0
 public SearchController(IRobotService robotService, IChoreService choreService)
 {
     _choreService = choreService;
     _robotService = robotService;
 }
Ejemplo n.º 26
0
    // remove these enums here, they should be implemented in their respective classes 'Robot' and 'Car'. Having a single responsibility class and being referenced to as a library, having it's own extension methods.

    /*enum RobotType
     * {
     *  RoboticDog,
     *  RoboticCat,
     *  RoboticDrone,
     *  RoboticCar
     * }
     *
     * enum CarType
     * {
     *  Toyota,
     *  Ford,
     *  Opel,
     *  Honda
     * }*/

    // Factory constructor is missing the ICarServiceo
    public Factory(IRobotService robotService, ICarService carService)
    {
        // Don't instantiate new instances, use dependency inversion principle, depend on abstraction, not concreation.
        _robotService = robotService;
        _carService   = carService;
    }
Ejemplo n.º 27
0
 public RobotController(IRobotService robotService) => _robotService = robotService;
Ejemplo n.º 28
0
 public BindManyRobotsHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
Ejemplo n.º 29
0
 public RobotsController(IRobotService robotService)
 {
     _robotService = robotService;
 }
Ejemplo n.º 30
0
        private static Robot Robot(IRobotService robotService, Plateau plateau)
        {
            var robot = robotService.GetRobot(plateau);

            return(robot);
        }
Ejemplo n.º 31
0
 public Application(IRobotService robotService, IOutputWriter outputWriter)
 {
     _robotService = robotService;
     _outputWriter = outputWriter;
 }