OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cellreflist.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWWORLD_CELLREFLIST_H
2 #define GAME_MWWORLD_CELLREFLIST_H
3 
4 #include <list>
5 
6 #include "livecellref.hpp"
7 
8 namespace MWWorld
9 {
11  template <typename X>
12  struct CellRefList
13  {
15  typedef std::list<LiveRef> List;
17 
25  void load (ESM::CellRef &ref, bool deleted, const MWWorld::ESMStore &esmStore);
26 
27  LiveRef &insert (const LiveRef &item)
28  {
29  mList.push_back(item);
30  return mList.back();
31  }
32 
34  void remove (const ESM::RefNum &refNum)
35  {
36  for (typename List::iterator it = mList.begin(); it != mList.end();)
37  {
38  if (*it == refNum)
39  mList.erase(it++);
40  else
41  ++it;
42  }
43  }
44  };
45 }
46 
47 #endif
Definition: livecellref.hpp:77
LiveRef & insert(const LiveRef &item)
Definition: cellreflist.hpp:27
Definition: cellref.hpp:14
Definition: esmstore.hpp:17
LiveCellRef< X > LiveRef
Definition: cellreflist.hpp:14
void load(ESM::CellRef &ref, bool deleted, const MWWorld::ESMStore &esmStore)
Definition: cellstore.cpp:178
std::list< LiveRef > List
Definition: cellreflist.hpp:15
List mList
Definition: cellreflist.hpp:16
Definition: cellref.hpp:34
Collection of references of one type.
Definition: cellreflist.hpp:12