本文整理汇总了C++中mwmechanics::DynamicStat::getModified方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicStat::getModified方法的具体用法?C++ DynamicStat::getModified怎么用?C++ DynamicStat::getModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mwmechanics::DynamicStat
的用法示例。
在下文中一共展示了DynamicStat::getModified方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setValue
void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<int>& value)
{
static const char *ids[] =
{
"HBar", "MBar", "FBar", 0
};
for (int i=0; ids[i]; ++i)
if (ids[i]==id)
{
switch (i)
{
case 0:
health->setProgressRange (value.getModified());
health->setProgressPosition (value.getCurrent());
break;
case 1:
magicka->setProgressRange (value.getModified());
magicka->setProgressPosition (value.getCurrent());
break;
case 2:
stamina->setProgressRange (value.getModified());
stamina->setProgressPosition (value.getCurrent());
break;
}
}
}
示例2: setValue
void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<float>& value)
{
static const char *ids[] =
{
"HBar", "MBar", "FBar", 0
};
for (int i=0; ids[i]; ++i)
if (ids[i]==id)
{
MyGUI::Widget* w;
std::string valStr = boost::lexical_cast<std::string>(value.getCurrent()) + "/" + boost::lexical_cast<std::string>(value.getModified());
switch (i)
{
case 0:
mHealth->setProgressRange (value.getModified());
mHealth->setProgressPosition (value.getCurrent());
getWidget(w, "HealthFrame");
w->setUserString("Caption_HealthDescription", "#{sHealthDesc}\n" + valStr);
break;
case 1:
mMagicka->setProgressRange (value.getModified());
mMagicka->setProgressPosition (value.getCurrent());
getWidget(w, "MagickaFrame");
w->setUserString("Caption_HealthDescription", "#{sIntDesc}\n" + valStr);
break;
case 2:
mStamina->setProgressRange (value.getModified());
mStamina->setProgressPosition (value.getCurrent());
getWidget(w, "FatigueFrame");
w->setUserString("Caption_HealthDescription", "#{sFatDesc}\n" + valStr);
break;
}
}
}
示例3: setValue
void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<float>& value)
{
int current = std::max(0, static_cast<int>(value.getCurrent()));
int modified = static_cast<int>(value.getModified());
MyGUI::Widget* w;
std::string valStr = MyGUI::utility::toString(current) + "/" + MyGUI::utility::toString(modified);
if (id == "HBar")
{
mHealth->setProgressRange(modified);
mHealth->setProgressPosition(current);
getWidget(w, "HealthFrame");
w->setUserString("Caption_HealthDescription", "#{sHealthDesc}\n" + valStr);
}
else if (id == "MBar")
{
mMagicka->setProgressRange (modified);
mMagicka->setProgressPosition (current);
getWidget(w, "MagickaFrame");
w->setUserString("Caption_HealthDescription", "#{sIntDesc}\n" + valStr);
}
else if (id == "FBar")
{
mStamina->setProgressRange (modified);
mStamina->setProgressPosition (current);
getWidget(w, "FatigueFrame");
w->setUserString("Caption_HealthDescription", "#{sFatDesc}\n" + valStr);
}
}
示例4: setValue
void StatsWindow::setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value)
{
static const char *ids[] =
{
"HBar", "MBar", "FBar",
0
};
for (int i=0; ids[i]; ++i)
if (ids[i]==id)
{
std::string id (ids[i]);
setBar (id, id + "T", value.getCurrent(), value.getModified());
}
}
示例5: setValue
void StatsWindow::setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value)
{
static const char *ids[] =
{
"HBar", "MBar", "FBar",
0
};
for (int i=0; ids[i]; ++i)
{
if (ids[i]==id)
{
std::string id (ids[i]);
setBar (id, id + "T", value.getCurrent(), value.getModified());
// health, magicka, fatigue tooltip
MyGUI::Widget* w;
std::string valStr = boost::lexical_cast<std::string>(value.getCurrent()) + "/" + boost::lexical_cast<std::string>(value.getModified());
if (i==0)
{
getWidget(w, "Health");
w->setUserString("Caption_HealthDescription", "#{sHealthDesc}\n" + valStr);
}
else if (i==1)
{
getWidget(w, "Magicka");
w->setUserString("Caption_HealthDescription", "#{sIntDesc}\n" + valStr);
}
else if (i==2)
{
getWidget(w, "Fatigue");
w->setUserString("Caption_HealthDescription", "#{sFatDesc}\n" + valStr);
}
}
}
}
示例6: setFatigue
void ReviewDialog::setFatigue(const MWMechanics::DynamicStat<float>& value)
{
mFatigue->setValue(value.getCurrent(), value.getModified());
std::string valStr = boost::lexical_cast<std::string>(value.getCurrent()) + "/" + boost::lexical_cast<std::string>(value.getModified());
mFatigue->setUserString("Caption_HealthDescription", "#{sFatDesc}\n" + valStr);
}
示例7: setFatigue
void ReviewDialog::setFatigue(const MWMechanics::DynamicStat<float>& value)
{
mFatigue->setValue(static_cast<int>(value.getCurrent()), static_cast<int>(value.getModified()));
std::string valStr = MyGUI::utility::toString(value.getCurrent()) + "/" + MyGUI::utility::toString(value.getModified());
mFatigue->setUserString("Caption_HealthDescription", "#{sFatDesc}\n" + valStr);
}
示例8: setFatigue
void ReviewDialog::setFatigue(const MWMechanics::DynamicStat<int>& value)
{
fatigue->setValue(value.getCurrent(), value.getModified());
}
示例9: setMagicka
void ReviewDialog::setMagicka(const MWMechanics::DynamicStat<int>& value)
{
magicka->setValue(value.getCurrent(), value.getModified());
}
示例10: setHealth
void ReviewDialog::setHealth(const MWMechanics::DynamicStat<int>& value)
{
health->setValue(value.getCurrent(), value.getModified());
}
示例11: update
void Actors::update (std::vector<std::pair<std::string, Ogre::Vector3> >& movement, float duration,
bool paused)
{
mDuration += duration;
if (mDuration>=0.25)
{
float totalDuration = mDuration;
mDuration = 0;
std::set<MWWorld::Ptr>::iterator iter (mActors.begin());
while (iter!=mActors.end())
{
if (!MWWorld::Class::get (*iter).getCreatureStats (*iter).isDead())
{
updateActor (*iter, totalDuration);
if (iter->getTypeName()==typeid (ESM::NPC).name())
updateNpc (*iter, totalDuration, paused);
}
if (MWWorld::Class::get (*iter).getCreatureStats (*iter).isDead())
{
// workaround: always keep player alive for now
// \todo remove workaround, once player death can be handled
if (iter->getRefData().getHandle()=="player")
{
MWMechanics::DynamicStat<float> stat (
MWWorld::Class::get (*iter).getCreatureStats (*iter).getHealth());
if (stat.getModified()<1)
{
stat.setModified (1, 0);
MWWorld::Class::get (*iter).getCreatureStats (*iter).setHealth (stat);
}
MWWorld::Class::get (*iter).getCreatureStats (*iter).resurrect();
++iter;
continue;
}
++mDeathCount[MWWorld::Class::get (*iter).getId (*iter)];
MWBase::Environment::get().getWorld()->playAnimationGroup (*iter, "death1", 0);
if (MWWorld::Class::get (*iter).isEssential (*iter))
MWBase::Environment::get().getWindowManager()->messageBox (
"#{sKilledEssential}", std::vector<std::string>());
mActors.erase (iter++);
}
else
++iter;
}
}
for (std::set<MWWorld::Ptr>::iterator iter (mActors.begin()); iter!=mActors.end();
++iter)
{
Ogre::Vector3 vector = MWWorld::Class::get (*iter).getMovementVector (*iter);
if (vector!=Ogre::Vector3::ZERO)
movement.push_back (std::make_pair (iter->getRefData().getHandle(), vector));
}
}