1 Star 0 Fork 7

LukeLee/PokerGame

forked from zhyuey/PokerGame 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pokercarditem.h 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef POKERCARDITEM_H
#define POKERCARDITEM_H
#include <QGraphicsSvgItem>
#include <QSvgRenderer>
enum Suit {NotKnownSuit = -3, Back, RedJoker, BlackJoker, Spade, Heart, Diamond, Club};
enum Status {PreGame, InHands, OutHands};
enum Rank {NotKnownRank = 0, Ace = 1, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King};
class PokerCardItem : public QGraphicsSvgItem
{
public:
enum { Type = UserType + 1 };
int type() const
{
// Enable the use of qgraphicsitem_cast with this item.
return Type;
}
explicit PokerCardItem(QGraphicsSvgItem *parent = 0);
~PokerCardItem();
int cardID() const;
void setCardID(int cardID);
bool getValid() const;
Rank rank() const;
Suit suit() const;
QSvgRenderer *renderer() const;
void loadImage();
void loadImageByRenderer(QSvgRenderer *);
bool clickable() const;
void setClickable(bool clickable);
static bool compareCard(const PokerCardItem* c1, const PokerCardItem* c2);
bool isClicked() const;
void setClicked(bool value);
private:
void setValid(bool value);
void setRank(const Rank &rank);
void setSuit(const Suit &suit);
void setRenderer(QSvgRenderer *renderer);
private:
int cardID_;
bool valid;
Rank rank_;
int owner_; //0 if it has no owner
Suit suit_;
Status status_;
QSvgRenderer *renderer_;
bool clickable_;
bool clicked;
};
#endif // POKERCARDITEM_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/luke47/PokerGame.git
git@gitee.com:luke47/PokerGame.git
luke47
PokerGame
PokerGame
master

搜索帮助