コード例 #1
0
        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);
        }
コード例 #2
0
 public FName(FNameEntrySerialized name, int index, int number, FNameComparisonMethod compare = FNameComparisonMethod.Index)
 {
     Name             = name;
     Index            = index;
     Number           = number;
     ComparisonMethod = compare;
 }
コード例 #3
0
 public FName(string name, int index = 0, int number = 0, FNameComparisonMethod compare = FNameComparisonMethod.Text)
 {
     Name             = new FNameEntrySerialized(name);
     Index            = index;
     Number           = number;
     ComparisonMethod = compare;
 }
コード例 #4
0
        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);
        }