lolautoaccept/include/lolautoaccept.h

62 lines
1.3 KiB
C
Raw Normal View History

#pragma once
2022-04-21 00:47:57 +02:00
#include <thread>
2022-06-29 23:09:01 +02:00
#include <memory>
#include "clientapi.h"
class LolAutoAccept {
2022-04-24 14:06:27 +02:00
protected:
struct Stage {
2022-06-29 23:09:01 +02:00
Stage();
2022-04-24 14:06:27 +02:00
virtual ~Stage();
std::vector<uint32_t> champids; // not every stage has a champ
2022-04-24 14:06:27 +02:00
bool enabled = false;
2022-07-03 00:31:13 +02:00
uint32_t currentOffset = 0;
2022-04-24 21:04:36 +02:00
};
2022-04-24 14:06:27 +02:00
std::vector<Stage*> stages;
2022-04-20 00:54:10 +02:00
bool shouldrun = false;
2022-04-21 00:47:57 +02:00
std::thread lolaathread;
2022-04-20 00:54:10 +02:00
2022-06-29 23:09:01 +02:00
std::shared_ptr<ClientAPI> clientapi;
2022-07-01 00:13:38 +02:00
int64_t summonerid = -1;
public:
2022-04-24 14:06:27 +02:00
enum class State {
LOBBY = 0,
PREPICK = 1,
BAN = 2,
PICK = 3,
GAME = 4
};
LolAutoAccept();
2022-04-21 00:47:57 +02:00
~LolAutoAccept();
2022-07-03 00:31:13 +02:00
void setChamps(const std::vector<uint32_t>& champs, State s);
2022-04-24 14:06:27 +02:00
void setEnabled(bool b, State s);
2022-03-08 00:04:56 +01:00
2022-04-20 00:54:10 +02:00
bool init(); // returns true on success
void run();
2022-04-20 00:54:10 +02:00
void stop();
2022-04-21 00:47:57 +02:00
private:
void stopJoinThread();
void innerRun();
2022-07-03 00:31:13 +02:00
void resetAllOffsets();
uint32_t getChampOfState(State s);
void nextChampOfState(State s);
2022-07-02 13:21:09 +02:00
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 phase(const ownactions_t& ownactions, ClientAPI::ChampSelectActionType type, State s, bool complete);
2022-07-02 13:21:09 +02:00
void champSelect();
};