当前位置: 首页>>代码示例>>C++>>正文


C++ DummyCard::subcardsLength方法代码示例

本文整理汇总了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;
}
开发者ID:ABigBigWhale,项目名称:QSanguosha-Para,代码行数:14,代码来源:serverplayer.cpp

示例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);
    }
开发者ID:uchihajiji,项目名称:QSanguosha-Para-tangjs520,代码行数:14,代码来源:serverplayer.cpp

示例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;
        }
开发者ID:bigambition,项目名称:QSanguosha-Para-tangjs520-yizhiyongheng,代码行数:19,代码来源:thicket.cpp


注:本文中的DummyCard::subcardsLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。