Example #1
0
static bool handle_move_to()
{
    while( input->ready() || ( std::cin.good() && !std::cin.eof() ) )
    {
        if( differential )
        {
            const position* position = input->read();
            if( !position ) { return true; }
            return handle_move_to< quickset::ptcr::commands::move_to_delta >( *position );
        }
        else
        {
            if( !target )
            {
                const position* position = input->read();
                if( !position ) { return true; }
                target = *position;
            }
            if( !handle_move_to< quickset::ptcr::commands::move_to >( *target ) ) { return false; }
            target.reset();
            return true;
        }
    }
    return true;
}