mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <thread>
|
|
#include <mutex>
|
|
#include <condition_variable>
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <unordered_map>
|
|
|
|
#include "AsstDef.h"
|
|
|
|
namespace asst {
|
|
class WinMacro;
|
|
class Identify;
|
|
|
|
class __declspec(dllexport) Assistance
|
|
{
|
|
public:
|
|
Assistance();
|
|
~Assistance();
|
|
|
|
std::optional<std::string> setSimulator(const std::string & simulator_name = std::string());
|
|
|
|
void start(const std::string & task);
|
|
void stop(bool block = true);
|
|
|
|
bool setParam(const std::string& type, const std::string& param, const std::string& value);
|
|
std::optional<std::string> getParam(const std::string& type, const std::string& param);
|
|
private:
|
|
static void workingProc(Assistance* pThis);
|
|
|
|
std::shared_ptr<WinMacro> m_pWindow = nullptr;
|
|
std::shared_ptr<WinMacro> m_pView = nullptr;
|
|
std::shared_ptr<WinMacro> m_pCtrl = nullptr;
|
|
std::shared_ptr<Identify> m_pIder = nullptr;
|
|
bool m_inited = false;
|
|
|
|
std::thread m_working_thread;
|
|
std::mutex m_mutex;
|
|
std::condition_variable m_condvar;
|
|
bool m_thread_exit = false;
|
|
bool m_thread_running = false;
|
|
std::vector<std::string> m_next_tasks;
|
|
};
|
|
|
|
} |