lolautoaccept/include/lolautoaccept.h

57 lines
1.1 KiB
C++

#pragma once
#include <thread>
#include <memory>
#include "clientapi.h"
class LolAutoAccept {
protected:
struct Stage {
Stage();
virtual ~Stage();
uint32_t champid = 0; // 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(uint32_t champ, State s);
void setEnabled(bool b, State s);
bool init(); // returns true on success
void run();
void stop();
private:
void stopJoinThread();
void innerRun();
using ownactions_t = std::vector<ClientAPI::ChampSelectAction>;
ownactions_t getOwnActions(int32_t cellid, const std::vector<ClientAPI::ChampSelectAction> actions);
void prepickPhase(const ownactions_t& ownactions);
void banPhase(const ownactions_t& ownactions);
void pickPhase( const ownactions_t& ownactions);
void champSelect();
};