1 Star 0 Fork 82

MrYou / Landlords

forked from ibc-dabing / Landlords 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
strategy.h 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
kevin 提交于 2021-12-16 00:16 . 代码优化, 提高程序的健壮性
#ifndef STRATEGY_H
#define STRATEGY_H
#include "player.h"
#include "playhand.h"
class Strategy
{
public:
Strategy(Player* player, const Cards& cards);
Cards makeStrategy();
Cards firstPlay();
Cards getGreaterCards(PlayHand type);
bool whetherToBeat(Cards& cs);
Cards findSamePointCards(Card::CardPoint point, int count);
QVector<Cards> findCardsByCount(int count);
Cards getRangeCards(Card::CardPoint begin, Card::CardPoint end);
QVector<Cards> findCardType(PlayHand hand, bool beat);
void pickSeqSingles(QVector<QVector<Cards>> &allSeqRecord, const QVector<Cards> &seqSingle, const Cards& cards);
QVector<Cards> pickOptimalSeqSingles();
private:
using function = Cards (Strategy::*)(Card::CardPoint point);
struct CardInfo
{
Card::CardPoint begin;
Card::CardPoint end;
int extra;
bool beat;
int number;
int base;
function getSeq;
};
QVector<Cards> getCards(Card::CardPoint point, int number);
QVector<Cards> getTripleSingleOrPair(Card::CardPoint begin, PlayHand::HandType type);
QVector<Cards> getPlane(Card::CardPoint begin);
QVector<Cards> getPlane2SingleOr2Pair(Card::CardPoint begin, PlayHand::HandType type);
QVector<Cards> getSepPairOrSeqSingle(CardInfo &info);
Cards getBaseSeqPair(Card::CardPoint point);
Cards getBaseSeqSingle(Card::CardPoint point);
QVector<Cards> getBomb(Card::CardPoint begin);
private:
Player* m_player;
Cards m_cards;
};
#endif // STRATEGY_H
1
https://gitee.com/y1096213112/landlords.git
git@gitee.com:y1096213112/landlords.git
y1096213112
landlords
Landlords
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891