lolautoaccept/include/lolautoaccept.h
2022-07-01 17:35:05 +02:00

50 lines
773 B
C++

#pragma once
#include <thread>
#include <memory>
#include "clientapi.h"
class LolAutoAccept {
protected:
struct Stage {
Stage();
virtual ~Stage();
std::string champ; // not every stage has a champ
bool enabled = false;
virtual void action(LolAutoAccept& lolaa);
};
std::vector<Stage*> stages;
bool shouldrun = false;
std::thread lolaathread;
std::shared_ptr<ClientAPI> clientapi;
int64_t summonerid = -1;
public:
enum class State {
LOBBY = 0,
PREPICK = 1,
BAN = 2,
PICK = 3,
GAME = 4
};
LolAutoAccept();
~LolAutoAccept();
void setChamp(const std::string& champ, State s);
void setEnabled(bool b, State s);
bool init(); // returns true on success
void run();
void stop();
private:
void stopJoinThread();
void innerRun();
};