Tre is many reasons to go your 2nd way. Not only impossibility of recognize some hands in one screenshoot.
Can describe my current system... but it is wery huge
I am not sure of my English for this
Lets try.
1st. You need structure called class TableInfo
Code:
class TableInfo{
public:
TableInfo();
void Clear();
int table_size;
double scale;
std::string Stacks[9];
std::string Nicks[9];
std::string Bets[9];
bool Dealers[9];
bool Closed_cards[9];
card_t Open_cards[2][9];
card_t Table_cards[5];
std::string pot;
std::string tournament_info;
bool Buttons[3];
std::string window_name;
int table_pos_x;
int table_pos_y;
cv::Rect ButtonRects[3];
std::string ToString();
};
You write there all things you recognize from the table
2nd. class BotManager
it have some member functions
-void StartFrame(); you need to say him that new screenshoot appears; //I`ll say why you nedd to do it later
-void AddTableInfo(TableInfo* ti);
(you must know that there is more than 1 table at the screen)
You need to release your logic here.
For example If I not see buttons (not my move) I can remember table position and nicks. In frame when my buttons appear previous player or two nicks are FOLD or CALL
Then when your bot manager decide that he know all hand correctly and there is time to get it to your bot - most interesting things begin
He must see in
SET OF QUESTIONS, may be he asked it before.
If there is no this question he must put this question in
QUEUEThats all.
You need also
DEMON in other thread. It gets question from queue (if exist) and ask your bot for the answer. It may take long time! For my bot it about 0.5sec now it is enougf for comfort play 6 tables. Sure you want not to freese your aplication for 0.5sec or more! (every second
)
Sorry for bad english (
ps. in StartFrame() you need to delete wery old questions from the SET. for example 20+ sec old. And may some other old stuff of your bot manager