1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/apps/openmw/mwworld/cellvisitors.hpp

41 lines
744 B
C++
Raw Normal View History

2015-12-06 18:13:04 +01:00
#ifndef GAME_MWWORLD_CELLVISITORS_H
#define GAME_MWWORLD_CELLVISITORS_H
#include <vector>
#include <string>
#include "ptr.hpp"
namespace MWWorld
{
2015-12-06 18:13:04 +01:00
struct ListAndResetObjectsVisitor
{
std::vector<MWWorld::Ptr> mObjects;
2021-06-23 23:13:59 +02:00
bool operator() (const MWWorld::Ptr& ptr)
{
if (ptr.getRefData().getBaseNode())
{
2018-10-09 10:21:12 +04:00
ptr.getRefData().setBaseNode(nullptr);
}
mObjects.push_back (ptr);
return true;
}
};
struct ListObjectsVisitor
{
std::vector<MWWorld::Ptr> mObjects;
2021-08-15 19:50:28 +02:00
bool operator() (const MWWorld::Ptr& ptr)
{
mObjects.push_back (ptr);
return true;
}
};
}
#endif