コード例 #1
0
        private void ExecuteCommand(char command)
        {
            if (command == 'L' || command == 'R')
            {
                var changeDirectionCommand = new ChangeDirectionCommand
                {
                    Side             = command.ToString(),
                    InitialDirection = this.Piece.Direction
                };

                this.Piece.Direction = _changeDirectionCommandDispatcher.Handle(changeDirectionCommand);
            }

            if (command == 'M')
            {
                var moveForwardCommand = new MoveForwardCommand
                {
                    Direction    = Piece.Direction,
                    InitialField = Piece.Field
                };

                this.Piece.Field = _moveForwardCommandDispatcher.Handle(moveForwardCommand);
            }
        }
コード例 #2
0
 public Task <Unit> Handle(ChangeDirectionCommand request, CancellationToken cancellationToken)
 {
     //TODO change this
     return(Task.FromResult(Unit.Value));
 }