mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-02 16:06:39 +00:00
Remove functions WorldModel::rest
and WorldModel::recharge
This commit is contained in:
parent
b8fb013edf
commit
0fef8f12d0
3 changed files with 11 additions and 30 deletions
|
@ -3401,7 +3401,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::rest(double hours)
|
void World::rest(double hours)
|
||||||
{
|
{
|
||||||
mWorldModel.rest(hours);
|
mWorldModel.forEachLoadedCellStore([hours](CellStore& store) { store.rest(hours); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::rechargeItems(double duration, bool activeOnly)
|
void World::rechargeItems(double duration, bool activeOnly)
|
||||||
|
@ -3417,7 +3417,7 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mWorldModel.recharge(duration);
|
mWorldModel.forEachLoadedCellStore([duration](CellStore& store) { store.recharge(duration); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::teleportToClosestMarker(const MWWorld::Ptr& ptr, const ESM::RefId& id)
|
void World::teleportToClosestMarker(const MWWorld::Ptr& ptr, const ESM::RefId& id)
|
||||||
|
|
|
@ -212,32 +212,6 @@ MWWorld::CellStore* MWWorld::WorldModel::getInterior(const ESM::RefId& name)
|
||||||
return &result->second;
|
return &result->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWWorld::WorldModel::rest(double hours)
|
|
||||||
{
|
|
||||||
for (auto& interior : mInteriors)
|
|
||||||
{
|
|
||||||
interior.second.rest(hours);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& exterior : mExteriors)
|
|
||||||
{
|
|
||||||
exterior.second.rest(hours);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWWorld::WorldModel::recharge(float duration)
|
|
||||||
{
|
|
||||||
for (auto& interior : mInteriors)
|
|
||||||
{
|
|
||||||
interior.second.recharge(duration);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& exterior : mExteriors)
|
|
||||||
{
|
|
||||||
exterior.second.recharge(duration);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MWWorld::CellStore* MWWorld::WorldModel::getCell(const ESM::CellId& id)
|
MWWorld::CellStore* MWWorld::WorldModel::getCell(const ESM::CellId& id)
|
||||||
{
|
{
|
||||||
if (id.mPaged)
|
if (id.mPaged)
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "cellstore.hpp"
|
||||||
#include "ptr.hpp"
|
#include "ptr.hpp"
|
||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
|
@ -82,8 +83,14 @@ namespace MWWorld
|
||||||
|
|
||||||
Ptr getPtr(const ESM::RefId& id, const ESM::RefNum& refNum);
|
Ptr getPtr(const ESM::RefId& id, const ESM::RefNum& refNum);
|
||||||
|
|
||||||
void rest(double hours);
|
template <typename Fn>
|
||||||
void recharge(float duration);
|
void forEachLoadedCellStore(Fn&& fn)
|
||||||
|
{
|
||||||
|
for (auto& [_, store] : mInteriors)
|
||||||
|
fn(store);
|
||||||
|
for (auto& [_, store] : mExteriors)
|
||||||
|
fn(store);
|
||||||
|
}
|
||||||
|
|
||||||
/// Get all Ptrs referencing \a name in exterior cells
|
/// Get all Ptrs referencing \a name in exterior cells
|
||||||
/// @note Due to the current implementation of getPtr this only supports one Ptr per cell.
|
/// @note Due to the current implementation of getPtr this only supports one Ptr per cell.
|
||||||
|
|
Loading…
Reference in a new issue