#ifndef MXLIST_H #define MXLIST_H #include "mxtypes.h" #include "mxcore.h" template class MxListEntry { public: MxListEntry() {} MxListEntry(T *p_obj) { m_obj = p_obj; m_prev = NULL; m_next = NULL; } T *m_obj; MxListEntry *m_prev; MxListEntry *m_next; }; // VTABLE 0x100d6350 // SIZE 0x10 template class MxListParent : public MxCore { public: MxListParent() { m_count = 0; m_customDestructor = Destroy; } // OFFSET: LEGO1 0x1001cdd0 virtual ~MxListParent() {} // OFFSET: LEGO1 0x1001cd30 static void Destroy(T *) {}; // OFFSET: LEGO1 0x1001cd20 virtual MxS8 Compare(T *, T *) = 0; protected: MxU32 m_count; // +0x8 void (*m_customDestructor)(T *); // +0xc }; // VTABLE 0x100d6368 // SIZE 0x18 template class MxList : protected MxListParent { public: MxList() { m_last = NULL; m_first = NULL; } virtual ~MxList(); protected: MxListEntry *m_first; // +0x10 MxListEntry *m_last; // +0x14 }; template // OFFSET: LEGO1 0x1001ce20 MxList::~MxList() { for (MxListEntry *t = m_first;;) { if (!t) break; MxListEntry *next = t->m_next; m_customDestructor(t->m_obj); delete t; t = next; } m_count = 0; m_last = NULL; m_first = NULL; } #endif // MXLIST_H