mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-08 09:37:53 +00:00
125b21de20
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
#ifndef GAME_MWWORLD_LOCALSCRIPTS_H
|
|
#define GAME_MWWORLD_LOCALSCRIPTS_H
|
|
|
|
#include <list>
|
|
#include <string>
|
|
|
|
#include "ptr.hpp"
|
|
|
|
namespace MWWorld
|
|
{
|
|
class ESMStore;
|
|
class CellStore;
|
|
class RefData;
|
|
|
|
/// \brief List of active local scripts
|
|
class LocalScripts
|
|
{
|
|
std::list<std::pair<ESM::RefId, Ptr>> mScripts;
|
|
std::list<std::pair<ESM::RefId, Ptr>>::iterator mIter;
|
|
const MWWorld::ESMStore& mStore;
|
|
|
|
public:
|
|
LocalScripts(const MWWorld::ESMStore& store);
|
|
|
|
void startIteration();
|
|
///< Set the iterator to the begin of the script list.
|
|
|
|
bool getNext(std::pair<ESM::RefId, Ptr>& script);
|
|
///< Get next local script
|
|
/// @return Did we get a script?
|
|
|
|
void add(const ESM::RefId& scriptName, const Ptr& ptr);
|
|
///< Add script to collection of active local scripts.
|
|
|
|
void addCell(CellStore* cell);
|
|
///< Add all local scripts in a cell.
|
|
|
|
void clear();
|
|
///< Clear active local scripts collection.
|
|
|
|
void clearCell(CellStore* cell);
|
|
///< Remove all scripts belonging to \a cell.
|
|
|
|
void remove(RefData* ref);
|
|
|
|
void remove(const Ptr& ptr);
|
|
///< Remove script for given reference (ignored if reference does not have a script listed).
|
|
};
|
|
}
|
|
|
|
#endif
|