public static IStruct read(ArkArchive archive, ArkName structType) { if (structType.Equals(_itemNetId) || structType.Equals(_transform) || structType.Equals(_primalPlayerDataStruct) || structType.Equals(_primalPlayerCharacterConfigStruct) || structType.Equals(_primalPersistentCharacterStatsStruct) || structType.Equals(_tribeData) || structType.Equals(_tribeGovernment) || structType.Equals(_terrainInfo) || structType.Equals(_itemNetInfo) || structType.Equals(_arkInventoryData) || structType.Equals(_dinoOrderGroup) || structType.Equals(_arkDinoData)) { return(new StructPropertyList(archive, structType)); } else if (structType.Equals(_vector) || structType.Equals(_rotator)) { return(new StructVector(archive, structType)); } else if (structType.Equals(_vector2d)) { return(new StructVector2d(archive, structType)); } else if (structType.Equals(_quat)) { return(new StructQuat(archive, structType)); } else if (structType.Equals(_color)) { return(new StructColor(archive, structType)); } else if (structType.Equals(_linearColor)) { return(new StructLinearColor(archive, structType)); } else if (structType.Equals(_uniqueNetIdRepl)) { return(new StructUniqueNetIdRepl(archive, structType)); } else { _logger.Warn($"Unknown Struct Type {structType} at {archive.Position:X} trying to read as StructPropertyList"); return(new StructPropertyList(archive, structType)); } }
public static IArkArray read(ArkArchive archive, ArkName arrayType, int size) { if (arrayType.Equals(_object)) { return(new ArkArrayObjectReference(archive, size)); } else if (arrayType.Equals(_struct)) { return(new ArkArrayStruct(archive, size)); } else if (arrayType.Equals(_uint32) || arrayType.Equals(_int)) { return(new ArkArrayInteger(archive, size)); } else if (arrayType.Equals(_uint16) || arrayType.Equals(_int16)) { return(new ArkArrayInt16(archive, size)); } else if (arrayType.Equals(_byte)) { return(new ArkArrayByte(archive, size)); } else if (arrayType.Equals(_int8)) { return(new ArkArrayInt8(archive, size)); } else if (arrayType.Equals(_str)) { return(new ArkArrayString(archive, size)); } else if (arrayType.Equals(_uint64)) { return(new ArkArrayLong(archive, size)); } else if (arrayType.Equals(_bool)) { return(new ArkArrayBool(archive, size)); } else if (arrayType.Equals(_float)) { return(new ArkArrayFloat(archive, size)); } else if (arrayType.Equals(_double)) { return(new ArkArrayDouble(archive, size)); } else if (arrayType.Equals(_name)) { return(new ArkArrayName(archive, size)); } else { _logger.Warn($"Unknown Array Type {arrayType} at {archive.Position:X}"); return(null); } }