public static FNameEntrySerialized[] LoadNameBatch(FArchive Ar) { var num = Ar.Read <int>(); if (num == 0) { return(Array.Empty <FNameEntrySerialized>()); } Ar.Position += sizeof(uint); // var numStringBytes = Ar.Read<uint>(); Ar.Position += sizeof(ulong); // var hashVersion = Ar.Read<ulong>(); Ar.Position += num * sizeof(ulong); // var hashes = Ar.ReadArray<ulong>(num); var headers = Ar.ReadArray <FSerializedNameHeader>(num); var entries = new FNameEntrySerialized[num]; for (var i = 0; i < num; i++) { var header = headers[i]; var length = (int)header.Length; string s = header.IsUtf16 ? new string(Ar.ReadArray <char>(length)) : Encoding.UTF8.GetString(Ar.ReadBytes(length)); entries[i] = new FNameEntrySerialized(s); } return(entries); }
public FName(FNameEntrySerialized name, int index, int number, FNameComparisonMethod compare = FNameComparisonMethod.Index) { Name = name; Index = index; Number = number; ComparisonMethod = compare; }
public FName(string name, int index = 0, int number = 0, FNameComparisonMethod compare = FNameComparisonMethod.Text) { Name = new FNameEntrySerialized(name); Index = index; Number = number; ComparisonMethod = compare; }
public static FNameEntrySerialized[] LoadNameBatch(FArchive nameAr, int nameCount) { var result = new FNameEntrySerialized[nameCount]; for (int i = 0; i < nameCount; i++) { result[i] = LoadNameHeader(nameAr); } return(result); }