private static InfoObject ReadObject(String str, ref int startIndex) { String type = ReadType(str, ref startIndex); String name = ReadString(str, ref startIndex); InfoObject obj = new InfoObject(ReadObjectContents(str, ref startIndex), type, name); if (startIndex < str.Length && str[startIndex] == ',') { ++startIndex; } return(obj); }
internal static void Register(InfoObject obj) { if (!myInfos.ContainsKey(obj.Type)) { myInfos.Add(obj.Type, new List <InfoObject>()); } for (int i = 0; i < myInfos[obj.Type].Count; ++i) { if (myInfos[obj.Type][i].Name == obj.Name) { myInfos[obj.Type][i] = obj; return; } } myInfos[obj.Type].Add(obj); }
internal static void Register( InfoObject obj ) { if ( !myInfos.ContainsKey( obj.Type ) ) myInfos.Add( obj.Type, new List<InfoObject>() ); for ( int i = 0; i < myInfos[ obj.Type ].Count; ++i ) if ( myInfos[ obj.Type ][ i ].Name == obj.Name ) { myInfos[ obj.Type ][ i ] = obj; return; } myInfos[ obj.Type ].Add( obj ); }
private static InfoObject ReadObject( String str, ref int startIndex ) { String type = ReadType( str, ref startIndex ); String name = ReadString( str, ref startIndex ); InfoObject obj = new InfoObject( ReadObjectContents( str, ref startIndex ), type, name ); if ( startIndex < str.Length && str[ startIndex ] == ',' ) ++startIndex; return obj; }