Example #1
0
LTBOOL CPropTypeMgr::Init(const char* szAttributeFile)
{
    if (g_pPropTypeMgr || !szAttributeFile) return LTFALSE;
    if (!Parse(szAttributeFile)) return LTFALSE;

	g_pPropTypeMgr = this;


	// Read in the properties for each prop type record...

	int nNum = 0;
	sprintf(s_aTagName, "%s%d", PTMGR_TAG, nNum);

	while (m_buteMgr.Exist(s_aTagName))
	{
		PROPTYPE* pPropType = debug_new(PROPTYPE);

		if (pPropType && pPropType->Init(m_buteMgr, s_aTagName, nNum))
		{
			pPropType->nId = nNum;
			m_PropTypeList.AddTail(pPropType);
		}
		else
		{
			debug_delete(pPropType);
            return LTFALSE;
		}

		nNum++;
		sprintf(s_aTagName, "%s%d", PTMGR_TAG, nNum);
	}


    return LTTRUE;
}