public void Initialize_Parsed_Enum( CEnumRecord record ) { EEnumID id = EEnumID.Invalid; if ( m_EnumIDMap.TryGetValue( record.FullName, out id ) ) { CEnum enum_instance = null; if ( !m_Enums.TryGetValue( id, out enum_instance ) ) { throw new Exception( "Internal error: enum id mapping exists, but not enum instance could be found" ); } enum_instance.Initialize_Existing( record ); } else { id = Allocate_Enum_ID(); CEnum enum_instance = new CEnum( id, record.HeaderFileID, record ); m_EnumIDMap.Add( record.FullName, id ); m_Enums.Add( id, enum_instance ); } }
// Methods // Private interface public void Initialize_DB_Enums() { foreach ( var enum_record in CEnumXMLDatabase.Instance.Enums ) { EEnumID id = Allocate_Enum_ID(); CEnum enum_instance = new CEnum( id, enum_record ); m_EnumIDMap.Add( enum_record.FullName, id ); m_Enums.Add( id, enum_instance ); } }