#pragma once #include #include #include #include "clientapi.h" class LolAutoAccept { protected: struct Stage { Stage(); virtual ~Stage(); std::vector champids; // not every stage has a champ bool enabled = false; uint32_t currentOffset = 0; }; std::mutex stagesMutex; // protects stagesvector std::vector stages; bool shouldrun = false; std::thread lolaathread; std::shared_ptr clientapi; int64_t summonerid = -1; public: enum class State { LOBBY = 0, BAN = 1, PICK = 2, }; LolAutoAccept(); ~LolAutoAccept(); void setChamps(const std::vector& champs, State s); void setEnabled(bool b, State s); bool init(); // returns true on success void run(); void stop(); private: void stopJoinThread(); void innerRun(); void resetAllOffsets(); uint32_t getChampOfState(State s); void nextChampOfState(State s); static bool isChampIntentofTeammate(uint32_t champid, const ClientAPI::ChampSelectSession& session); using ownactions_t = std::vector; ownactions_t getOwnActions(int32_t cellid, const std::vector actions); void prepickPhase(const ownactions_t& ownactions); void banPhase(const ownactions_t& ownactions, const ClientAPI::ChampSelectSession& session); void pickPhase(const ownactions_t& ownactions); void phase(const ownactions_t& ownactions, ClientAPI::ChampSelectActionType type, State s, bool complete, std::function filter = {}); void champSelect(); };