mirror of
https://github.com/GTAmodding/re3.git
synced 2021-09-07 08:09:38 +00:00
35 lines
476 B
C++
35 lines
476 B
C++
#pragma once
|
|
|
|
namespace base
|
|
{
|
|
|
|
template<typename T>
|
|
class cSList
|
|
{
|
|
public:
|
|
struct tSItem
|
|
{
|
|
tSItem* next;
|
|
T item;
|
|
};
|
|
// extra field on PS2
|
|
tSItem* first;
|
|
|
|
cSList() { first = nil; }
|
|
void Insert(tSItem* item) { tSItem* n = first; first = item; item->next = n; }
|
|
void Remove(tSItem* item) {
|
|
if (first == item) {
|
|
first = item->next;
|
|
return;
|
|
}
|
|
tSItem* i = first;
|
|
while (i && i->next != item)
|
|
i = i->next;
|
|
assert(i);
|
|
i->next = item->next;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} |