2021-12-06 21:15:31 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QImage>
|
|
|
|
#include <leptonica/allheaders.h>
|
2022-08-15 11:14:37 -04:00
|
|
|
#include <tesseract/baseapi.h>
|
2021-12-06 21:15:31 -05:00
|
|
|
|
|
|
|
enum class ScreenState {
|
|
|
|
Splash,
|
|
|
|
LobbyError,
|
|
|
|
WorldFull,
|
|
|
|
ConnectingToDataCenter,
|
|
|
|
EnteredTitleScreen,
|
|
|
|
InLoginQueue
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GameParseResult {
|
|
|
|
ScreenState state;
|
|
|
|
|
|
|
|
int playersInQueue = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline bool operator==(const GameParseResult a, const GameParseResult b) {
|
|
|
|
return a.state == b.state && a.playersInQueue == b.playersInQueue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool operator!=(const GameParseResult a, const GameParseResult b) {
|
|
|
|
return !(a == b);
|
|
|
|
}
|
|
|
|
|
|
|
|
class GameParser {
|
|
|
|
public:
|
|
|
|
GameParser();
|
|
|
|
~GameParser();
|
|
|
|
|
|
|
|
GameParseResult parseImage(QImage image);
|
|
|
|
|
|
|
|
private:
|
|
|
|
tesseract::TessBaseAPI* api;
|
|
|
|
};
|