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); }
public override object LoadFromArchive(BinaryReader stream) { InfoValue value = InfoValue.ReadFromStream(stream); Info.Register(value as InfoObject); return(value); }
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); } }
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); } }
internal InfoArray( InfoValue[] value ) { myVal = value; }