summaryrefslogtreecommitdiff
path: root/common/GameUI/ObjectList.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /common/GameUI/ObjectList.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'common/GameUI/ObjectList.h')
-rw-r--r--common/GameUI/ObjectList.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/common/GameUI/ObjectList.h b/common/GameUI/ObjectList.h
new file mode 100644
index 0000000..b52a0ce
--- /dev/null
+++ b/common/GameUI/ObjectList.h
@@ -0,0 +1,58 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+// ObjectList.h: interface for the ObjectList class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef OBJECTLIST_H
+#define OBJECTLIST_H
+
+#pragma once
+
+#include "IObjectContainer.h" // Added by ClassView
+
+class ObjectList : public IObjectContainer
+{
+public:
+ void Init();
+ bool Add( void * newObject );
+ void * GetFirst();
+ void * GetNext();
+
+
+
+ ObjectList();
+ virtual ~ObjectList();
+
+ void Clear( bool freeElementsMemory );
+ int CountElements();
+ void * RemoveTail();
+ void * RemoveHead();
+
+ bool AddTail(void * newObject);
+ bool AddHead(void * newObject);
+ bool Remove(void * object);
+ bool Contains(void * object);
+ bool IsEmpty();
+
+ typedef struct element_s {
+ element_s * prev; // pointer to the last element or NULL
+ element_s * next; // pointer to the next elemnet or NULL
+ void * object; // the element's object
+ } element_t;
+
+protected:
+
+ element_t * head; // first element in list
+ element_t * tail; // last element in list
+ element_t * current; // current element in list
+ int number;
+
+};
+
+#endif // !defined