summaryrefslogtreecommitdiff
path: root/src/leeds/base
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-01-23 02:36:13 +0300
committerNikolay Korolev <nickvnuk@gmail.com>2021-01-23 02:36:13 +0300
commit917cf44defae5d304f590c8754e448b875d56357 (patch)
treea4efb80b549ef19089d70c2634b7ab07172b7588 /src/leeds/base
parentbdb216bf7c7192d35c247831f1feaf5c61ebadd8 (diff)
script coronas
Diffstat (limited to 'src/leeds/base')
-rw-r--r--src/leeds/base/sList.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/leeds/base/sList.h b/src/leeds/base/sList.h
new file mode 100644
index 00000000..378d8e31
--- /dev/null
+++ b/src/leeds/base/sList.h
@@ -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;
+
+ }
+
+};
+
+} \ No newline at end of file