本文整理汇总了C++中Skill::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Skill::getName方法的具体用法?C++ Skill::getName怎么用?C++ Skill::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill::getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validate
DECLARE_EXPORT void ResourceSkill::validate(Action action)
{
// Catch null operation and resource pointers
Skill *skill = getSkill();
Resource *res = getResource();
if (!skill || !res)
{
// Invalid load model
if (!skill && !res)
throw DataException("Missing resource and kill on a resourceskill");
else if (!skill)
throw DataException("Missing skill on a resourceskill on resource '"
+ res->getName() + "'");
else if (!res)
throw DataException("Missing resource on a resourceskill on skill '"
+ skill->getName() + "'");
}
// Check if a resourceskill with 1) identical resource, 2) identical skill and
// 3) overlapping effectivity dates already exists
Skill::resourcelist::const_iterator i = skill->getResources().begin();
for (; i != skill->getResources().end(); ++i)
if (i->getResource() == res
&& i->getEffective().overlap(getEffective())
&& &*i != this)
break;
// Apply the appropriate action
switch (action)
{
case ADD:
if (i != skill->getResources().end())
{
throw DataException("Resourceskill of '" + res->getName() + "' and '"
+ skill->getName() + "' already exists");
}
break;
case CHANGE:
throw DataException("Can't update a resourceskill");
case ADD_CHANGE:
// ADD is handled in the code after the switch statement
if (i == skill->getResources().end()) break;
throw DataException("Can't update a resourceskill");
case REMOVE:
// This resourceskill was only used temporarily during the reading process
delete this;
if (i == skill->getResources().end())
// Nothing to delete
throw DataException("Can't remove nonexistent resourceskill of '"
+ res->getName() + "' and '" + skill->getName() + "'");
delete &*i;
return;
}
}
示例2: setName
void Test_Skill::setName()
{
Skill testSkill;
string name = "SkillName";
testSkill.setName(name);
QVERIFY(testSkill.getName() == name);
}
示例3: attack
void Character::attack(Character* character, int idSkill )
{
Skill* skill = ObjectList::lSkill.at( idSkill );
std::cout << "\nLe sort " << skill->getName() << " est lance par " << this->m_name <<
" sur " << character->m_name << '\n' << skill->getPunchline() << '\n';
switch( skill->getSkillEffect() )
{
case PHYS_ATT :
{
int thisAtt = (skill->getPower() + this->m_stat.physicalAtt);
thisAtt = thisAtt - character->m_stat.physicalDef/4;
if( thisAtt < 1 )
{
thisAtt = 1;
}
character->m_stat.life -= thisAtt;
std::cout << character->m_name << " se voit inflige -" << thisAtt << "PV.\n";
break;
}
case MAG_ATT :
{
int thisAtt = (skill->getPower() + this->m_stat.magicalAtt);
thisAtt = thisAtt - character->m_stat.magicalDef/4;
if( thisAtt < 1 )
{
thisAtt = 1;
}
this->m_stat.mana--;
character->m_stat.life -= thisAtt;
std::cout << character->m_name << " se voit inflige -" << thisAtt << "PV.\n";
break;
}
case HEAL :
this->m_stat.mana--;
character->m_stat.life += skill->getPower();
std::cout << character->m_name << " recoit +" << skill->getPower() << "PV.\n";
break;
default :
std::cout << "TADADADAAAAMMM !!";
std::exit(17);
}
std::cout << "Vie de " << character->m_name << " : " << character->m_stat.life << "PV.\n";
}
示例4:
Skill::Skill(const Skill& other)
{
set(other.get());
setName(other.getName());
setDescription(other.getDescription());
}
示例5: return
bool operator==(const Skill &s1, const Skill &s2) {
return (s1.getName() == s2.getName());
}