2011-10-06 10:29:59 +00:00
|
|
|
#ifndef GAME_MWWORLD_LOCALSCRIPTS_H
|
|
|
|
#define GAME_MWWORLD_LOCALSCRIPTS_H
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "ptr.hpp"
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2015-03-06 08:36:42 +00:00
|
|
|
class ESMStore;
|
2012-07-03 11:55:53 +00:00
|
|
|
class CellStore;
|
2013-01-13 17:05:12 +00:00
|
|
|
class RefData;
|
2012-07-03 11:55:53 +00:00
|
|
|
|
2011-10-06 10:29:59 +00:00
|
|
|
/// \brief List of active local scripts
|
|
|
|
class LocalScripts
|
|
|
|
{
|
|
|
|
std::list<std::pair<std::string, Ptr> > mScripts;
|
|
|
|
std::list<std::pair<std::string, Ptr> >::iterator mIter;
|
2012-10-01 15:17:04 +00:00
|
|
|
const MWWorld::ESMStore& mStore;
|
2011-10-06 10:29:59 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2012-10-01 15:17:04 +00:00
|
|
|
LocalScripts (const MWWorld::ESMStore& store);
|
2011-10-07 07:52:42 +00:00
|
|
|
|
2011-10-06 10:29:59 +00:00
|
|
|
void startIteration();
|
|
|
|
///< Set the iterator to the begin of the script list.
|
|
|
|
|
2016-02-03 15:09:20 +00:00
|
|
|
bool getNext(std::pair<std::string, Ptr>& script);
|
|
|
|
///< Get next local script
|
|
|
|
/// @return Did we get a script?
|
2011-10-06 10:29:59 +00:00
|
|
|
|
|
|
|
void add (const std::string& scriptName, const Ptr& ptr);
|
|
|
|
///< Add script to collection of active local scripts.
|
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
void addCell (CellStore *cell);
|
2011-10-07 07:52:42 +00:00
|
|
|
///< Add all local scripts in a cell.
|
|
|
|
|
2011-10-06 10:29:59 +00:00
|
|
|
void clear();
|
|
|
|
///< Clear active local scripts collection.
|
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
void clearCell (CellStore *cell);
|
2011-10-06 10:29:59 +00:00
|
|
|
///< Remove all scripts belonging to \a cell.
|
2013-01-13 17:05:12 +00:00
|
|
|
|
|
|
|
void remove (RefData *ref);
|
2011-10-06 10:29:59 +00:00
|
|
|
|
|
|
|
void remove (const Ptr& ptr);
|
2015-12-14 01:57:55 +00:00
|
|
|
///< Remove script for given reference (ignored if reference does not have a script listed).
|
2011-10-06 10:29:59 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|