本文整理汇总了C++中interpreter::Runtime类的典型用法代码示例。如果您正苦于以下问题:C++ Runtime类的具体用法?C++ Runtime怎么用?C++ Runtime使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Runtime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
virtual void execute (Interpreter::Runtime& runtime)
{
std::string topic = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWBase::Environment::get().getDialogueManager()->addTopic(topic);
}
示例2: execute
virtual void execute (Interpreter::Runtime& runtime)
{
MWScript::InterpreterContext& context
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
std::string id = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWWorld::Ptr ptr = context.getWorld().getPtr (id, false);
if (mIndex==0 && MWWorld::Class::get (ptr).hasItemHealth (ptr))
{
// health is a special case
Interpreter::Type_Integer value =
MWWorld::Class::get (ptr).getItemMaxHealth (ptr);
runtime.push (value);
return;
}
Interpreter::Type_Integer value =
MWWorld::Class::get (ptr).getCreatureStats (ptr).mDynamic[mIndex].
getCurrent();
runtime.push (value);
}
示例3: operator
MWWorld::Ptr operator() (Interpreter::Runtime& runtime) const
{
std::string id = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
return MWBase::Environment::get().getWorld()->getPtr (id, false);
}
示例4: execute
virtual void execute (Interpreter::Runtime& runtime)
{
float param = runtime[0].mFloat;
runtime.pop();
runtime.push(std::sqrt (param));
}
示例5: execute
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
if (cell->getCell()->hasWater())
runtime.push (cell->getWaterLevel());
else
runtime.push (-std::numeric_limits<float>().max());
}
示例6: execute
virtual void execute (Interpreter::Runtime &runtime)
{
MWWorld::Ptr actor = R()(runtime);
std::string targetID = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWWorld::Ptr target = MWBase::Environment::get().getWorld()->getPtr(targetID, true);
MWBase::Environment::get().getMechanicsManager()->startCombat(actor, target);
}
示例7: execute
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::Ptr ptr = R()(runtime);
std::string sound = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWBase::Environment::get().getSoundManager()->stopSound3D (ptr, sound);
}
示例8: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context =
static_cast<InterpreterContext&> (runtime.getContext());
MWWorld::Ptr ptr = context.getReference();
runtime.push (MWBase::Environment::get().getWindowManager()->readPressedButton());
}
示例9: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context =
static_cast<InterpreterContext&> (runtime.getContext());
MWWorld::Ptr ptr = context.getReference();
runtime.push (context.hasBeenActivated (ptr));
}
示例10: execute
virtual void execute (Interpreter::Runtime& runtime)
{
std::string quest = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
Interpreter::Type_Integer index = runtime[0].mInteger;
runtime.pop();
MWBase::Environment::get().getJournal()->setJournalIndex (quest, index);
}
示例11: execute
virtual void execute (Interpreter::Runtime& runtime)
{
std::string region = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
Interpreter::Type_Integer id = runtime[0].mInteger;
runtime.pop();
MWBase::Environment::get().getWorld()->changeWeather(region, id);
}
示例12: execute
virtual void execute (Interpreter::Runtime& runtime)
{
std::string faction1 = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
std::string faction2 = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
runtime.push(MWBase::Environment::get().getDialogueManager()
->getFactionReaction(faction1, faction2));
}
示例13: execute
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::Ptr ptr = R()(runtime);
std::string item = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
runtime.push (store.count(item));
}
示例14: execute
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::Ptr ptr = R()(runtime);
std::string id = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
// make sure a spell with this ID actually exists.
MWBase::Environment::get().getWorld()->getStore().spells.find (id);
MWWorld::Class::get (ptr).getCreatureStats (ptr).mSpells.add (id);
}
示例15: execute
virtual void execute (Interpreter::Runtime& runtime)
{
if (!MWMechanics::getPlayer().isInCell())
{
runtime.push (0);
return;
}
bool interior =
!MWMechanics::getPlayer().getCell()->getCell()->isExterior();
runtime.push (interior ? 1 : 0);
}