mirror of
https://github.com/halpz/re3.git
synced 2025-07-27 14:32:46 +00:00
script coronas
This commit is contained in:
35
src/leeds/base/sList.h
Normal file
35
src/leeds/base/sList.h
Normal file
@ -0,0 +1,35 @@
|
||||
#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;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user