Пример #1
0
        private static Dictionary <String, InfoValue> ReadObjectContents(String str, ref int startIndex)
        {
            Dictionary <String, InfoValue> dict = new Dictionary <string, InfoValue>();

            startIndex = str.IndexOf('{', startIndex) + 1;

            MovePastWhitespace(str, ref startIndex);

            while (str[startIndex] != '}')
            {
                String key = ReadString(str, ref startIndex);
                MovePastWhitespace(str, ref startIndex);
                ++startIndex;
                InfoValue val = ReadValue(str, ref startIndex);
                if (val is InfoObject)
                {
                    (val as InfoObject).Name = key;
                }
                dict.Add(key, val);
            }

            ++startIndex;
            MovePastWhitespace(str, ref startIndex);

            return(dict);
        }
Пример #2
0
        public override object LoadFromArchive(BinaryReader stream)
        {
            InfoValue value = InfoValue.ReadFromStream(stream);

            Info.Register(value as InfoObject);
            return(value);
        }
Пример #3
0
        internal InfoArray(BinaryReader reader)
            : base(reader)
        {
            int len = reader.ReadInt32();

            myVal = new InfoValue[len];

            for (int i = 0; i < len; ++i)
            {
                myVal[i] = InfoValue.ReadFromStream(reader);
            }
        }
Пример #4
0
        internal InfoObject(BinaryReader reader)
            : base(reader)
        {
            Type = reader.ReadString();
            Name = reader.ReadString();

            int count = reader.ReadInt32();

            myDict = new Dictionary <string, InfoValue>();

            for (int i = 0; i < count; ++i)
            {
                string    key = reader.ReadString();
                InfoValue val = InfoValue.ReadFromStream(reader);
                myDict.Add(key, val);
            }
        }
Пример #5
0
 internal InfoArray( InfoValue[] value )
 {
     myVal = value;
 }