Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Read() [1/2]

void Terraria.IO.FileMetadata.Read ( BinaryReader reader)
inlineprivate

Definition at line 56 of file FileMetadata.cs.

57 {
58 ulong num = reader.ReadUInt64();
59 if ((num & 0xFFFFFFFFFFFFFFL) != 27981915666277746L)
60 {
61 throw new FormatException("Expected Re-Logic file format.");
62 }
63 byte b = (byte)((num >> 56) & 0xFF);
64 FileType fileType = FileType.None;
65 FileType[] array = (FileType[])Enum.GetValues(typeof(FileType));
66 for (int i = 0; i < array.Length; i++)
67 {
68 if ((uint)array[i] == b)
69 {
70 fileType = array[i];
71 break;
72 }
73 }
74 if (fileType == FileType.None)
75 {
76 throw new FormatException("Found invalid file type.");
77 }
78 Type = fileType;
79 Revision = reader.ReadUInt32();
80 ulong num2 = reader.ReadUInt64();
81 IsFavorite = (num2 & 1) == 1;
82 }
static Array GetValues(Type enumType)
Definition Enum.cs:323
virtual ulong ReadUInt64()
virtual uint ReadUInt32()

References System.array, System.Enum.GetValues(), Terraria.IO.FileMetadata.IsFavorite, System.L, System.IO.BinaryReader.ReadUInt32(), System.IO.BinaryReader.ReadUInt64(), and Terraria.IO.FileMetadata.Revision.