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


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

本文整理汇总了C++中DummyCard::addSubcards方法的典型用法代码示例。如果您正苦于以下问题:C++ DummyCard::addSubcards方法的具体用法?C++ DummyCard::addSubcards怎么用?C++ DummyCard::addSubcards使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DummyCard的用法示例。


在下文中一共展示了DummyCard::addSubcards方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

    virtual const Card *viewAs(const QList<CardItem *> &cards) const{
        if(cards.length() != 2)
            return NULL;

        DummyCard *card = new DummyCard;
        card->setSkillName(objectName());
        card->addSubcards(cards);
        return card;
    }
开发者ID:kdashsoul,项目名称:QSanguoshaPassMode,代码行数:9,代码来源:standard-cards.cpp

示例2: onDamaged

    virtual void onDamaged(ServerPlayer *target, const DamageStruct &damage) const{
        Room *room = target->getRoom();
        if (!target->askForSkillInvoke(objectName(), QVariant::fromValue(damage))) return;
        room->broadcastSkillInvoke(objectName());

        QList<int> card_ids = room->getNCards(4);
        room->fillAG(card_ids);

        QList<int> to_get, to_throw;
        while (true) {
            int sum = 0;
            foreach (int id, to_get)
                sum += Sanguosha->getCard(id)->getNumber();
            foreach (int id, card_ids) {
                if (sum + Sanguosha->getCard(id)->getNumber() >= 13) {
                    room->takeAG(NULL, id, false);
                    card_ids.removeOne(id);
                    to_throw << id;
                }
            }
            if (card_ids.isEmpty()) break;

            int card_id = room->askForAG(target, card_ids, card_ids.length() < 4, objectName());
            if (card_id == -1) break;
            card_ids.removeOne(card_id);
            to_get << card_id;
            room->takeAG(target, card_id, false);
            if (card_ids.isEmpty()) break;
        }
        DummyCard *dummy = new DummyCard;
        if (!to_get.isEmpty()) {
            dummy->addSubcards(to_get);
            target->obtainCard(dummy);
        }
        dummy->clearSubcards();
        if (!to_throw.isEmpty() || !card_ids.isEmpty()) {
            dummy->addSubcards(to_throw + card_ids);
            CardMoveReason reason(CardMoveReason::S_REASON_NATURAL_ENTER, target->objectName(), objectName(), QString());
            room->throwCard(dummy, reason, NULL);
        }
        delete dummy;

        room->clearAG();
    }
开发者ID:guihuoliuying,项目名称:QSanguosha-Para,代码行数:44,代码来源:yjcm2013.cpp

示例3:

    virtual const Card *viewAs(const QList<CardItem *> &cards) const{
        int x = Self->getMark("BlackArmor");
        if(cards.length() != x)
            return NULL;

        DummyCard *card = new DummyCard;
        card->setSkillName(objectName());
        card->addSubcards(cards);
        return card;
    }
开发者ID:Lycio,项目名称:FolkExtensionMod,代码行数:10,代码来源:chibi-card.cpp


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