2015-12-06 18:13:04 +01:00
|
|
|
#ifndef GAME_MWWORLD_CELLVISITORS_H
|
|
|
|
#define GAME_MWWORLD_CELLVISITORS_H
|
2011-01-29 14:33:44 +01:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
2014-01-01 22:37:52 +01:00
|
|
|
#include "ptr.hpp"
|
2011-01-29 14:33:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2015-12-06 18:13:04 +01:00
|
|
|
struct ListAndResetObjectsVisitor
|
2011-01-29 14:33:44 +01:00
|
|
|
{
|
2015-05-12 03:02:15 +02:00
|
|
|
std::vector<MWWorld::Ptr> mObjects;
|
2011-01-29 14:33:44 +01:00
|
|
|
|
2021-06-23 23:13:59 +02:00
|
|
|
bool operator() (const MWWorld::Ptr& ptr)
|
2011-01-29 14:33:44 +01:00
|
|
|
{
|
2015-05-12 03:02:15 +02:00
|
|
|
if (ptr.getRefData().getBaseNode())
|
|
|
|
{
|
2018-10-09 10:21:12 +04:00
|
|
|
ptr.getRefData().setBaseNode(nullptr);
|
2015-05-12 03:02:15 +02:00
|
|
|
}
|
2021-02-05 14:55:42 +01:00
|
|
|
mObjects.push_back (ptr);
|
2013-04-17 17:05:54 +02:00
|
|
|
|
2011-01-29 14:33:44 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
2021-02-05 14:55:42 +01:00
|
|
|
|
|
|
|
struct ListObjectsVisitor
|
|
|
|
{
|
|
|
|
std::vector<MWWorld::Ptr> mObjects;
|
|
|
|
|
2021-08-15 19:50:28 +02:00
|
|
|
bool operator() (const MWWorld::Ptr& ptr)
|
2021-02-05 14:55:42 +01:00
|
|
|
{
|
|
|
|
mObjects.push_back (ptr);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
2011-01-29 14:33:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|