本文整理汇总了C++中CCard::getHealth方法的典型用法代码示例。如果您正苦于以下问题:C++ CCard::getHealth方法的具体用法?C++ CCard::getHealth怎么用?C++ CCard::getHealth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCard
的用法示例。
在下文中一共展示了CCard::getHealth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkCard
//.........这里部分代码省略.........
return true;
}
}
if (mIsFilterOptionEnabled)
{
bool passRarity(true);
switch (card.getType())
{
case EAssaultType:
switch (card.getRarity())
{
case ECommonRarity: passRarity = mIsAssaultAllowed[3]; break;
case EUncommonRarity: passRarity = mIsAssaultAllowed[2]; break;
case ERareRarity: passRarity = mIsAssaultAllowed[1]; break;
case ELegendaryRarity: passRarity = mIsAssaultAllowed[0]; break;
default: break;
}
break;
case ECommanderType:
switch (card.getRarity())
{
case ECommonRarity: passRarity = mIsCommanderAllowed[3]; break;
case EUncommonRarity: passRarity = mIsCommanderAllowed[2]; break;
case ERareRarity: passRarity = mIsCommanderAllowed[1]; break;
case ELegendaryRarity: passRarity = mIsCommanderAllowed[0]; break;
default: break;
}
break;
case EStructureType:
switch (card.getRarity())
{
case ECommonRarity: passRarity = mIsStructureAllowed[3]; break;
case EUncommonRarity: passRarity = mIsStructureAllowed[2]; break;
case ERareRarity: passRarity = mIsStructureAllowed[1]; break;
case ELegendaryRarity: passRarity = mIsStructureAllowed[0]; break;
default: break;
}
break;
case EActionType:
switch (card.getRarity())
{
case ECommonRarity: passRarity = mIsActionAllowed[3]; break;
case EUncommonRarity: passRarity = mIsActionAllowed[2]; break;
case ERareRarity: passRarity = mIsActionAllowed[1]; break;
case ELegendaryRarity: passRarity = mIsActionAllowed[0]; break;
default: break;
}
break;
default:
break;
}
bool passFaction(true);
bool passHealth(true);
bool passAttack(true);
bool passDelay(true);
if (mIsAssaultOptionEnabled && card.getType() == EAssaultType)
{
switch(card.getFaction())
{
case EBloodthirstyFaction: passFaction = mIsFactionAllowed[0]; break;
case EImperialFaction: passFaction = mIsFactionAllowed[1]; break;
case ERaiderFaction: passFaction = mIsFactionAllowed[2]; break;
case ERighteousFaction: passFaction = mIsFactionAllowed[3]; break;
case EXenoFaction: passFaction = mIsFactionAllowed[4]; break;
default: break;
}
switch (card.getHealth())
{
case 1: passHealth = mIsHealthAllowed[0]; break;
case 2: passHealth = mIsHealthAllowed[1]; break;
case 3: passHealth = mIsHealthAllowed[2]; break;
case 4: passHealth = mIsHealthAllowed[3]; break;
case 5:
default: passHealth = mIsHealthAllowed[4]; break;
}
switch (card.getAttack())
{
case 0: passAttack = mIsAttackAllowed[0]; break;
case 1: passAttack = mIsAttackAllowed[1]; break;
case 2: passAttack = mIsAttackAllowed[2]; break;
case 3: passAttack = mIsAttackAllowed[3]; break;
case 4:
default: passAttack = mIsAttackAllowed[4]; break;
}
switch (card.getDelay())
{
case 0: passDelay = mIsDelayAllowed[0]; break;
case 1: passDelay = mIsDelayAllowed[1]; break;
case 2: passDelay = mIsDelayAllowed[2]; break;
case 3: passDelay = mIsDelayAllowed[3]; break;
case 4: passDelay = mIsDelayAllowed[4]; break;
default: break;
}
}
return passRarity && passFaction && passHealth && passAttack && passDelay;
}
return true;
}
示例2: checkCard
bool CCardSearchParameters::checkCard(const CCard &card, int &/*num*/) const
{
bool pass(true);
if (pass)
{
pass = card.getLwCsName().contains(mLwCsName);
}
if (pass)
{
switch(mAttackCompare)
{
case ECompareLarger: pass = qMax(0, card.getAttack()) > mAttackValue; break;
case ECompareEqualOrLarger: pass = qMax(0, card.getAttack()) >= mAttackValue; break;
case ECompareEqual: pass = qMax(0, card.getAttack()) == mAttackValue; break;
case ECompareEqualOrLesser: pass = qMax(0, card.getAttack()) <= mAttackValue; break;
case ECompareLesser: pass = qMax(0, card.getAttack()) < mAttackValue; break;
default: pass = false; break;
}
}
if (pass)
{
switch(mHpCompare)
{
case ECompareLarger: pass = qMax(0, card.getHealth()) > mHpValue; break;
case ECompareEqualOrLarger: pass = qMax(0, card.getHealth()) >= mHpValue; break;
case ECompareEqual: pass = qMax(0, card.getHealth()) == mHpValue; break;
case ECompareEqualOrLesser: pass = qMax(0, card.getHealth()) <= mHpValue; break;
case ECompareLesser: pass = qMax(0, card.getHealth()) < mHpValue; break;
default: pass = false; break;
}
}
if (pass && mRarityMask != 0)
{
switch (card.getRarity())
{
case ELegendaryRarity: pass = (mRarityMask & 0x1) != 0; break;
case ERareRarity: pass = (mRarityMask & 0x2) != 0; break;
case EUncommonRarity: pass = (mRarityMask & 0x4) != 0; break;
case ECommonRarity: pass = (mRarityMask & 0x8) != 0; break;
default: pass = false; break;
}
}
if (pass && mTypeMask != 0)
{
switch (card.getType())
{
case EAssaultType: pass = (mTypeMask & 0x1) != 0; break;
case EStructureType: pass = (mTypeMask & 0x2) != 0; break;
case ECommanderType: pass = (mTypeMask & 0x4) != 0; break;
case EActionType: pass = (mTypeMask & 0x8) != 0; break;
default: pass = false; break;
}
}
if (pass && mFactionMask != 0)
{
switch (card.getFaction())
{
case EBloodthirstyFaction: pass = (mFactionMask & 0x1) != 0; break;
case EImperialFaction: pass = (mFactionMask & 0x2) != 0; break;
case ERaiderFaction: pass = (mFactionMask & 0x4) != 0; break;
case ERighteousFaction: pass = (mFactionMask & 0x8) != 0; break;
case EXenoFaction: pass = (mFactionMask & 0x10) != 0; break;
default: pass = false; break;
}
}
if (pass && mTimerMask != 0)
{
switch (card.getDelay())
{
case 0: pass = (mTimerMask & 0x1) != 0; break;
case 1: pass = (mTimerMask & 0x2) != 0; break;
case 2: pass = (mTimerMask & 0x4) != 0; break;
case 3: pass = (mTimerMask & 0x8) != 0; break;
case 4: pass = (mTimerMask & 0x10) != 0; break;
default: pass = false; break;
}
}
if (pass && mCheckUpgradeLevel)
{
switch(mUpgradeLevel)
{
case 0: pass = card.getUpgradeLevel() == EUpgradeNotAvailable; break;
case 1: pass = card.getUpgradeLevel() == EUpgradeLevel1; break;
case 2: pass = card.getUpgradeLevel() == EUpgradeLevel2; break;
default: pass = false; break;
}
}
if (pass && mIsUnique)
{
pass = card.isUnique();
//.........这里部分代码省略.........