Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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 );
        }
Example #4
0
        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;
        }