本文整理汇总了C++中mwworld::CellStore::getWaterLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ CellStore::getWaterLevel方法的具体用法?C++ CellStore::getWaterLevel怎么用?C++ CellStore::getWaterLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mwworld::CellStore
的用法示例。
在下文中一共展示了CellStore::getWaterLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
virtual void execute (Interpreter::Runtime& runtime)
{
Interpreter::Type_Float level = runtime[0].mFloat;
MWWorld::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
if (cell->getCell()->isExterior())
throw std::runtime_error("Can't set water level in exterior cell");
cell->setWaterLevel (cell->getWaterLevel()+level);
MWBase::Environment::get().getWorld()->setWaterHeight(cell->getWaterLevel());
}
示例2: execute
virtual void execute (Interpreter::Runtime& runtime)
{
if (!MWMechanics::getPlayer().isInCell())
{
runtime.push(0.f);
return;
}
MWWorld::CellStore *cell = MWMechanics::getPlayer().getCell();
if (cell->getCell()->hasWater())
runtime.push (cell->getWaterLevel());
else
runtime.push (-std::numeric_limits<float>::max());
}
示例3: execute
virtual void execute (Interpreter::Runtime& runtime)
{
if (!MWMechanics::getPlayer().isInCell())
{
runtime.push(0.f);
return;
}
MWWorld::CellStore *cell = MWMechanics::getPlayer().getCell();
if (cell->isExterior())
runtime.push(0.f); // vanilla oddity, return 0 even though water is actually at -1
else if (cell->getCell()->hasWater())
runtime.push (cell->getWaterLevel());
else
runtime.push (-std::numeric_limits<float>::max());
}