コード例 #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;
 }
コード例 #3
0
 public CrawlerBaseController(IRequestService requestService,
                              IStatusService statusService, IRobotService robotService,
                              ISiteService siteService, ICrawlerBaseExecutor executor)
 {
     _requestService = requestService;
     _statusService  = statusService;
     _robotService   = robotService;
     _siteService    = siteService;
     _executor       = executor;
 }
コード例 #4
0
 public RobotController(
     IRobotService robotService,
     IBackgroundJobClient client,
     IUserService userService,
     IMapper mapper) : base(mapper)
 {
     _robotService = robotService;
     _userService  = userService;
     _client       = client;
 }
コード例 #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();
        }
コード例 #6
0
        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);
                }
            }
                );
        }
コード例 #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"));
        }
コード例 #8
0
 public DataInitializer(IRobotService robotService)
 {
     _robotService = robotService;
 }
コード例 #9
0
 public WarService(IRobotService robotService)
 {
     _robotService = robotService;
 }
コード例 #10
0
 public BindRobotHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
コード例 #11
0
 public RobotController(IRobotService robotService)
 {
     this.robotService = robotService;
 }
コード例 #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;
        }
コード例 #13
0
 public RobotController(IRobotService robotService, IMapper mapper)
 {
     _robotService = robotService;
     _mapper       = mapper;
 }
コード例 #14
0
 public RobotController(HelpersManager helperManager, IRobotService robotService, IHubContext <NotificationHub> notificationHub)
 {
     _helpersManager  = helperManager;
     _robotService    = robotService;
     _notificationHub = notificationHub;
 }
コード例 #15
0
 public RefreshRobotCacheFilter(HelpersManager helpersManager, IRobotService robotService)
 {
     _helpersManager = helpersManager;
     _robotService   = robotService;
 }
コード例 #16
0
 public RobotsController(IRobotService service, ILogger <RobotsController> logger)
 {
     _service = service;
     _logger  = logger;
 }
コード例 #17
0
 public BattleService(IRobotService robotService, ICyborgService cyborgService)
 {
     _robotService    = robotService;
     _cyborgService   = cyborgService;
     _randomGenerator = new Random();
 }
コード例 #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);
 }
コード例 #19
0
 public RobotController(IMapper mapper, IRobotService robotService)
 {
     _mapper       = mapper;
     _robotService = robotService;
 }
コード例 #20
0
ファイル: DriveHandler.cs プロジェクト: Zuravvski/BSc-Thesis
 public DriveHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
コード例 #21
0
ファイル: HomeController.cs プロジェクト: arnaldo145/RobotAM
 public HomeController(IRobotService robotService)
 {
     _robotService = robotService;
 }
コード例 #22
0
 public BrowseAvailableRobotsHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
コード例 #23
0
 public RobotsUpdateRequestProcess(IRobotService robotService, ILogger <RobotsUpdateRequestProcess> logger)
 {
     m_robotService = robotService;
     m_logger       = logger;
 }
コード例 #24
0
 public AdminsController(IAdminService adminService, IRobotService robotService)
 {
     this.adminService = adminService;
     this.robotService = robotService;
 }
コード例 #25
0
 public SearchController(IRobotService robotService, IChoreService choreService)
 {
     _choreService = choreService;
     _robotService = robotService;
 }
コード例 #26
0
ファイル: Factory.cs プロジェクト: JvanDyk/Nebula
    // 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;
    }
コード例 #27
0
 public RobotController(IRobotService robotService) => _robotService = robotService;
コード例 #28
0
 public BindManyRobotsHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
コード例 #29
0
 public RobotsController(IRobotService robotService)
 {
     _robotService = robotService;
 }
コード例 #30
0
ファイル: Program.cs プロジェクト: ecesari/GlassFiller
        private static Robot Robot(IRobotService robotService, Plateau plateau)
        {
            var robot = robotService.GetRobot(plateau);

            return(robot);
        }
コード例 #31
0
ファイル: Application.cs プロジェクト: FinestV/RobotTest
 public Application(IRobotService robotService, IOutputWriter outputWriter)
 {
     _robotService = robotService;
     _outputWriter = outputWriter;
 }