-
-
Notifications
You must be signed in to change notification settings - Fork 317
Expand file tree
/
Copy pathReadableClass.cs
More file actions
24 lines (18 loc) · 817 Bytes
/
Copy pathReadableClass.cs
File metadata and controls
24 lines (18 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
namespace LibCpp2IL;
public abstract class ReadableClass
{
private LibCpp2IlContext? _owningContext;
internal float MetadataVersion { get; set; }
internal LibCpp2IlContext OwningContext
{
get => _owningContext ?? throw new InvalidOperationException("OwningContext has not been initialized.");
set => _owningContext = value;
}
protected bool IsAtLeast(float vers) => MetadataVersion >= vers;
protected bool IsLessThan(float vers) => MetadataVersion < vers;
protected bool IsAtMost(float vers) => MetadataVersion <= vers;
protected bool IsNot(float vers) => Math.Abs(MetadataVersion - vers) > 0.001f;
protected bool Is(float vers) => Math.Abs(MetadataVersion - vers) < 0.001f;
public abstract void Read(ClassReadingBinaryReader reader);
}