mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
30 lines
552 B
C++
30 lines
552 B
C++
#include "SwipeTask.h"
|
|
|
|
#include "WinMacro.h"
|
|
|
|
using namespace asst;
|
|
|
|
SwipeTask::SwipeTask(AsstCallback callback, void* callback_arg)
|
|
: AbstractTask(callback, callback_arg)
|
|
{
|
|
m_task_type = TaskType::TaskTypeClick;
|
|
}
|
|
|
|
bool asst::SwipeTask::run()
|
|
{
|
|
return swipe();
|
|
}
|
|
|
|
bool asst::SwipeTask::swipe()
|
|
{
|
|
bool ret = false;
|
|
if (!m_reverse) {
|
|
ret = m_control_ptr->swipe(m_swipe_begin, m_swipe_end, m_swipe_duration);
|
|
}
|
|
else {
|
|
ret = m_control_ptr->swipe(m_swipe_end, m_swipe_begin, m_swipe_duration);
|
|
}
|
|
ret &= sleep(SwipeExtraDelay);
|
|
return ret;
|
|
}
|