#include "Gos.pch"
#include "ClassInfo.h"

GosObj::GosObj( GosClassInfo *pClassInfo )
{
	static DWORD nextID = 0;	// switch to hash-based system asap

	// link into end of circular list w/ pClassInfo as the anchor
	m_pNext = pClassInfo;
	m_pPrev = pClassInfo->m_pPrev;
	pClassInfo->m_pPrev = this;
	m_ID = nextID++;
}

GosObj::GosObj()
{
	static DWORD nextClassID = 0x80000000;	// switch to hash-based system asap

	// create anchor node
	m_pNext = this;
	m_pPrev = this;
	m_ID = nextClassID++;
}

GosObj::~GosObj()
{
	// unhook from linked list
	m_pNext->m_pPrev = m_pPrev;
	m_pPrev->m_pNext = m_pNext;
}