1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/apps/openmw/mwworld/cellvisitors.hpp
2021-08-15 19:50:28 +02:00

41 lines
744 B
C++

#ifndef GAME_MWWORLD_CELLVISITORS_H
#define GAME_MWWORLD_CELLVISITORS_H
#include <vector>
#include <string>
#include "ptr.hpp"
namespace MWWorld
{
struct ListAndResetObjectsVisitor
{
std::vector<MWWorld::Ptr> mObjects;
bool operator() (const MWWorld::Ptr& ptr)
{
if (ptr.getRefData().getBaseNode())
{
ptr.getRefData().setBaseNode(nullptr);
}
mObjects.push_back (ptr);
return true;
}
};
struct ListObjectsVisitor
{
std::vector<MWWorld::Ptr> mObjects;
bool operator() (const MWWorld::Ptr& ptr)
{
mObjects.push_back (ptr);
return true;
}
};
}
#endif