1 Star 0 Fork 88

momo/Landlords

forked from ibc-dabing/Landlords 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
player.cpp 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
kevin 提交于 2021-12-16 00:16 . 代码优化, 提高程序的健壮性
#include "player.h"
Player::Player(QObject *parent) : QObject(parent)
{
}
Player::Player(QString name, QObject *parent) : Player(parent)
{
m_name = name;
}
void Player::setName(QString name)
{
m_name = name;
}
QString Player::getName()
{
return m_name;
}
void Player::setRole(Role role)
{
m_role = role;
}
Player::Role Player::getRole()
{
return m_role;
}
void Player::setSex(Sex sex)
{
m_sex = sex;
}
Player::Sex Player::getSex()
{
return m_sex;
}
void Player::setDirection(Direction direction)
{
m_direction = direction;
}
Player::Direction Player::getDirection()
{
return m_direction;
}
void Player::setType(Type type)
{
m_type = type;
}
Player::Type Player::getType()
{
return m_type;
}
void Player::setScore(int score)
{
m_score = score;
}
int Player::getScore()
{
return m_score;
}
void Player::setWin(bool flag)
{
m_isWin = flag;
}
bool Player::isWin()
{
return m_isWin;
}
void Player::setPrevPlayer(Player *player)
{
m_prev = player;
}
void Player::setNextPlayer(Player *player)
{
m_next = player;
}
Player *Player::getPrevPlayer()
{
return m_prev;
}
Player *Player::getNextPlayer()
{
return m_next;
}
void Player::grabLordBet(int point)
{
emit notifyGrabLordBet(this, point);
}
void Player::storeDispatchCard(const Card &card)
{
m_cards.add(card);
Cards cs;
cs.add(card);
emit notifyPickCards(this, cs);
}
void Player::storeDispatchCard(const Cards &cards)
{
m_cards.add(cards);
emit notifyPickCards(this, cards);
}
Cards Player::getCards()
{
return m_cards;
}
void Player::clearCards()
{
m_cards.clear();
}
void Player::playHand(const Cards &cards)
{
m_cards.remove(cards);
emit notifyPlayHand(this, cards);
}
Player *Player::getPendPlayer()
{
return m_pendPlayer;
}
Cards Player::getPendCards()
{
return m_pendCards;
}
void Player::storePendingInfo(Player *player, const Cards &cards)
{
m_pendPlayer = player;
m_pendCards = cards;
}
void Player::prepareCallLord()
{
}
void Player::preparePlayHand()
{
}
void Player::thinkCallLord()
{
}
void Player::thinkPlayHand()
{
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dataoffical/landlords.git
git@gitee.com:dataoffical/landlords.git
dataoffical
landlords
Landlords
master

搜索帮助