代码拉取完成,页面将自动刷新
同步操作将从 ibc-dabing/Landlords 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "robot.h"
#include "strategy.h"
#include "robotgraplord.h"
#include "robotplayhand.h"
#include <QDebug>
Robot::Robot(QObject *parent) : Player(parent)
{
m_type = Player::Robot;
}
void Robot::prepareCallLord()
{
RobotGrapLord* subThread = new RobotGrapLord(this);
connect(subThread, &RobotGrapLord::finished, this, [=](){
qDebug() << "RobotGrapLord 子线程对象析构..." << ", Robot name: " << this->getName();
subThread->deleteLater();
});
subThread->start();
}
void Robot::preparePlayHand()
{
RobotPlayHand* subThread = new RobotPlayHand(this);
connect(subThread, &RobotGrapLord::finished, this, [=](){
qDebug() << "RobotPlayHand 子线程对象析构..." << ", Robot name: " << this->getName();
subThread->deleteLater();
});
subThread->start();
}
void Robot::thinkCallLord()
{
int weight = 0;
Strategy st(this, m_cards);
weight += st.getRangeCards(Card::Card_SJ, Card::Card_BJ).cardCount() * 6;
QVector<Cards> optSeq = st.pickOptimalSeqSingles();
weight += optSeq.size() * 5;
QVector<Cards> bombs = st.findCardsByCount(4);
weight += bombs.size() * 5;
weight += m_cards.pointCount(Card::Card_2) * 3;
Cards tmp = m_cards;
tmp.remove(optSeq);
tmp.remove(bombs);
Cards card2 = st.getRangeCards(Card::Card_2, Card::Card_2);
tmp.remove(card2);
QVector<Cards> triples = Strategy(this, tmp).findCardsByCount(3);
weight += triples.size() * 4;
tmp.remove(triples);
QVector<Cards> pairs = Strategy(this, tmp).findCardsByCount(2);
weight += pairs.size() * 1;
if(weight >= 22)
{
grabLordBet(3);
}
else if(weight < 22 && weight >=18)
{
grabLordBet(2);
}
else if(weight < 18 && weight >= 10)
{
grabLordBet(1);
}
else
{
grabLordBet(0);
}
}
void Robot::thinkPlayHand()
{
Strategy st(this, m_cards);
Cards cs = st.makeStrategy();
playHand(cs);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。