private MetaArray ReadPointerArray(XmlNode node) { var arrayValue = new MetaArray(); if (node.ChildNodes.Count > 0) { arrayValue.Entries = new List <IMetaValue>(); foreach (XmlNode xmlPointerValue in node.ChildNodes) { MetaGeneric gen = new MetaGeneric(); var theType = xmlPointerValue.Attributes["type"].Value; if (!theType.Equals("NULL")) { var theHash = GetHashForName(theType); var xnd = FindAndCheckStructure(theHash, xmlPointerValue); var yy = ParseStructure(xmlPointerValue, xnd); gen.Value = yy; } arrayValue.Entries.Add(gen); } } return(arrayValue); }
public void AssertPointer(MetaGeneric expectedPointer, MetaGeneric actualPointer) { if (expectedPointer.Value == null) { Assert.IsNull(actualPointer.Value); } else { Assert.IsNotNull(actualPointer.Value); AssertValue(expectedPointer.Value, actualPointer.Value); } }
private static MetaArray MakeStructurePointerArray() { var metainf111 = new StructureInfo_GTA5_pc(); metainf111.StructureNameHash = 0x2D8B6A9C; MetaStructure metasubstr1 = new MetaStructure(null, metainf111); metasubstr1.Values = new Dictionary <int, IMetaValue>(); metasubstr1.Values.Add(unchecked ((int)0x04792618), new MetaBoolean(false)); metasubstr1.Values.Add(unchecked ((int)0xD302778A), new MetaBoolean(true)); MetaGeneric pointerValue1 = new MetaGeneric(); pointerValue1.Value = metasubstr1; var metainf222 = new StructureInfo_GTA5_pc(); metainf222.StructureNameHash = unchecked ((int)0xA71A1B09); MetaStructure metasubstr2 = new MetaStructure(null, metainf222); metasubstr2.Values = new Dictionary <int, IMetaValue>(); metasubstr2.Values.Add(unchecked ((int)0x8705BF6F), new MetaBoolean(true)); metasubstr2.Values.Add(unchecked ((int)0x981F3DBC), new MetaBoolean(false)); MetaGeneric pointerValue2 = new MetaGeneric(); pointerValue2.Value = metasubstr2; MetaGeneric pointerValue3 = new MetaGeneric(); pointerValue3.Value = null; MetaArray pointerArray = new MetaArray(); pointerArray.info = new StructureEntryInfo_GTA5_pc(); pointerArray.info.DataType = StructureEntryDataType.Structure; pointerArray.Entries = new List <IMetaValue>(); pointerArray.Entries.Add(pointerValue1); pointerArray.Entries.Add(pointerValue2); pointerArray.Entries.Add(pointerValue3); return(pointerArray); }