本文整理汇总了C++中DummyCard::subcardsLength方法的典型用法代码示例。如果您正苦于以下问题:C++ DummyCard::subcardsLength方法的具体用法?C++ DummyCard::subcardsLength怎么用?C++ DummyCard::subcardsLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DummyCard
的用法示例。
在下文中一共展示了DummyCard::subcardsLength方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throwAllEquips
void ServerPlayer::throwAllEquips() {
QList<const Card *> equips = getEquips();
if (equips.isEmpty()) return;
DummyCard *card = new DummyCard;
foreach (const Card *equip, equips) {
if (!isJilei(card))
card->addSubcard(equip);
}
if (card->subcardsLength() > 0)
room->throwCard(card, this);
delete card;
}
示例2: throwAllCards
void ServerPlayer::throwAllCards() {
DummyCard *card = isKongcheng() ? new DummyCard : wholeHandCards();
QList<const Card *> equips = getEquips();
foreach (const Card *equip, equips)
card->addSubcard(equip);
if (card->subcardsLength() != 0)
room->throwCard(card, this);
delete card;
QList<const Card *> tricks = getJudgingArea();
foreach (const Card *trick, tricks) {
CardMoveReason reason(CardMoveReason::S_REASON_THROW, this->objectName());
room->throwCard(trick, reason, NULL);
}
示例3: trigger
virtual bool trigger(TriggerEvent, Room *room, ServerPlayer *caopi, QVariant &data) const{
DeathStruct death = data.value<DeathStruct>();
ServerPlayer *player = death.who;
if (player->isNude() || caopi == player)
return false;
if (caopi->isAlive() && room->askForSkillInvoke(caopi, objectName(), data)) {
room->broadcastSkillInvoke(objectName());
DummyCard *dummy = new DummyCard(player->handCards());
QList <const Card *> equips = player->getEquips();
foreach (const Card *card, equips)
dummy->addSubcard(card);
if (dummy->subcardsLength() > 0) {
CardMoveReason reason(CardMoveReason::S_REASON_RECYCLE, caopi->objectName());
room->obtainCard(caopi, dummy, reason, false);
}
delete dummy;
}