コード例 #1
0
        public async void Execute(object parameter)
        {
            var client = new RoverServiceClient();

            VM.Result = await client.SetupRoverAsync(VM.InitialPositionX, VM.InitialPositionY, VM.HeadingChar);

            VM.CurrentRover = new MarsRoverApiModel.Rover(VM.InitialPositionX, VM.InitialPositionY, VM.HeadingChar);
        }
コード例 #2
0
        public async void Execute(object parameter)
        {
            var client = new RoverServiceClient();

            VM.Result = await client.SetupPlateauAsync(VM.UpperBoundX, VM.UpperBoundY);

            VM.CurrentPlateau = new MarsRoverApiModel.Plateau(VM.UpperBoundX, VM.UpperBoundY);
            VM.Path           = null;
        }
コード例 #3
0
        public async void Execute(object parameter)
        {
            var client = new RoverServiceClient();

            VM.Result = await client.MoveAsync(VM.Command);

            VM.CurrentRover.Move(VM.Command, VM.CurrentPlateau);
            VM.Path    = VM.CurrentRover.Path;
            VM.Command = "";
            VM.RaiseRedrawCanvas();
        }
コード例 #4
0
        public async void Execute(object parameter)
        {
            var client  = new RoverServiceClient();
            var history = await client.GetHistoryAsync();

            if (history != null)
            {
                await VM.Navigation.PushAsync(new HistoryPage
                {
                    BindingContext = history
                });
            }
        }