| 8 | #include "include/Card.h" |
| 9 | |
| 10 | StrategyExplorer::StrategyExplorer(QWidget *parent,QSolverJob * qSolverJob) : |
| 11 | QDialog(parent), |
| 12 | ui(new Ui::StrategyExplorer) |
| 13 | { |
| 14 | this->qSolverJob = qSolverJob; |
| 15 | this->detailWindowSetting = DetailWindowSetting(); |
| 16 | ui->setupUi(this); |
| 17 | /* |
| 18 | QStandardItemModel* model = new QStandardItemModel(); |
| 19 | for (int row = 0; row < 4; ++row) { |
| 20 | QStandardItem *item = new QStandardItem(QString("%1").arg(row) ); |
| 21 | model->appendRow( item ); |
| 22 | } |
| 23 | this->ui->gameTreeView->setModel(model); |
| 24 | */ |
| 25 | // Initial Game Tree preview panel |
| 26 | this->ui->gameTreeView->setTreeData(qSolverJob); |
| 27 | connect( |
| 28 | this->ui->gameTreeView, |
| 29 | SIGNAL(expanded(const QModelIndex&)), |
| 30 | this, |
| 31 | SLOT(item_expanded(const QModelIndex&)) |
| 32 | ); |
| 33 | connect( |
| 34 | this->ui->gameTreeView, |
| 35 | SIGNAL(clicked(const QModelIndex&)), |
| 36 | this, |
| 37 | SLOT(item_clicked(const QModelIndex&)) |
| 38 | ); |
| 39 | |
| 40 | // Initize strategy(rough) table |
| 41 | this->tableStrategyModel = new TableStrategyModel(this->qSolverJob,this); |
| 42 | this->ui->strategyTableView->setModel(this->tableStrategyModel); |
| 43 | this->delegate_strategy = new StrategyItemDelegate(this->qSolverJob,&(this->detailWindowSetting),this); |
| 44 | this->ui->strategyTableView->setItemDelegate(this->delegate_strategy); |
| 45 | |
| 46 | Deck* deck = this->qSolverJob->get_solver()->get_deck(); |
| 47 | int index = 0; |
| 48 | QString board_qstring = QString::fromStdString(this->qSolverJob->board); |
| 49 | for(Card one_card: deck->getCards()){ |
| 50 | if(board_qstring.contains(QString::fromStdString(one_card.toString())))continue; |
| 51 | QString card_str_formatted = QString::fromStdString(one_card.toFormattedString()); |
| 52 | this->ui->turnCardBox->addItem(card_str_formatted); |
| 53 | this->ui->riverCardBox->addItem(card_str_formatted); |
| 54 | |
| 55 | if(card_str_formatted.contains(QString::fromLocal8Bit("♦️")) || |
| 56 | card_str_formatted.contains(QString::fromLocal8Bit("♥️️"))){ |
| 57 | this->ui->turnCardBox->setItemData(0, QBrush(Qt::red),Qt::ForegroundRole); |
| 58 | this->ui->riverCardBox->setItemData(0, QBrush(Qt::red),Qt::ForegroundRole); |
| 59 | }else{ |
| 60 | this->ui->turnCardBox->setItemData(0, QBrush(Qt::black),Qt::ForegroundRole); |
| 61 | this->ui->riverCardBox->setItemData(0, QBrush(Qt::black),Qt::ForegroundRole); |
| 62 | } |
| 63 | |
| 64 | this->cards.push_back(one_card); |
| 65 | index += 1; |
| 66 | } |
| 67 | if(this->qSolverJob->get_solver()->getGameTree()->getRoot()->getRound() == GameTreeNode::GameRound::FLOP){ |
nothing calls this directly
no test coverage detected