Class MtDti
- Namespace
- SharpPluginLoader.Core
- Assembly
- SharpPluginLoader.Core.dll
This class represents a Monster Hunter World: Iceborne data type info.
public class MtDti : MtObject
- Inheritance
-
MtDti
- Inherited Members
Constructors
MtDti()
Constructs a new instance of MtDti with nullptr as the native pointer.
public MtDti()
MtDti(nint)
Constructs a new instance of MtDti with the specified native pointer.
public MtDti(nint instance)
Parameters
instance
nint
Properties
AllChildren
Gets all classes that inherit from this class (directly or indirectly).
public MtDti[] AllChildren { get; }
Property Value
- MtDti[]
AllocatorIndex
Gets the index of the allocator used by this class.
public uint AllocatorIndex { get; }
Property Value
Attributes
Gets the attributes of the class.
public uint Attributes { get; }
Property Value
Child
Gets the first child class of this class.
public MtDti? Child { get; }
Property Value
Children
Gets all classes that inherit directly from this class.
public MtDti[] Children { get; }
Property Value
- MtDti[]
Id
Gets the id of the class.
public uint Id { get; }
Property Value
Link
Gets the linked class of this class. This property is used by the game to form a hash table of classes.
public MtDti? Link { get; }
Property Value
Name
Gets the name of the class.
public string Name { get; }
Property Value
Next
Gets the next class in the list.
public MtDti? Next { get; }
Property Value
Parent
Gets the parent class of this class.
public MtDti? Parent { get; }
Property Value
Size
Gets the size in bytes of the class.
public uint Size { get; }
Property Value
Methods
CreateInstance<T>()
Creates and instantiates a new instance of the of the type represented by this class.
public T CreateInstance<T>() where T : MtObject, new()
Returns
- T
The created object
Type Parameters
T
The type of the object
Find(string)
Finds a DTI by its name.
public static MtDti? Find(string name)
Parameters
name
stringThe fully qualified name of the class
Returns
- MtDti
The DTI or null if no DTI was found
Find(uint)
Finds a DTI by its id.
public static MtDti? Find(uint id)
Parameters
id
uintThe id of the class
Returns
- MtDti
The DTI or null if no DTI was found
InheritsFrom(MtDti)
Checks if this class inherits from the specified class.
public bool InheritsFrom(MtDti dti)
Parameters
dti
MtDtiThe class to check for
Returns
- bool
True if the class inherits from the specified class
InheritsFrom(string)
Checks if this class inherits from the class with the specified name.
public bool InheritsFrom(string name)
Parameters
name
stringThe name of the class to check
Returns
- bool
True if the class inherits from the specified class
InheritsFrom(uint)
Checks if this class inherits from the class with the specified CRC.
public bool InheritsFrom(uint id)
Parameters
id
uintThe CRC hash of the class to check
Returns
- bool
True if the class inherits from the specified class
Instantiate<T>(T)
Instantiates the specified object with the type represented by this class.
public T? Instantiate<T>(T obj) where T : MtObject
Parameters
obj
TThe object to instantiate
Returns
- T
The object if the instantiation was successfull or null
Type Parameters
T
The type of the object
MakeId(string)
Computes the dti id of a class from its name.
public static uint MakeId(string name)
Parameters
name
stringThe name of the class
Returns
- uint
The computed dti id of the class
Register(string, long, DtiDtorDelegate, DtiNewDelegate, DtiCtorDelegate, DtiCtorArrayDelegate, MtDti?, uint, int)
Registers a new DTI.
public static MtDti Register(string name, long size, DtiDtorDelegate dtor, DtiNewDelegate @new, DtiCtorDelegate ctor, DtiCtorArrayDelegate ctorArray, MtDti? parent = null, uint attr = 0, int allocatorIndex = 0)
Parameters
name
stringThe name of the class
size
longThe size of the class
dtor
DtiDtorDelegateThe DTI's destructor
new
DtiNewDelegateThe factory method for creating new instances of the class
ctor
DtiCtorDelegateThe constructor for initializing new instances of the class
ctorArray
DtiCtorArrayDelegateThe constructor for initializing arrays of instances of the class
parent
MtDtiThe parent class of the class, use MtObject if unsure
attr
uintThe attributes of the class, mostly unknown
allocatorIndex
intThe index of the allocator used by the class, leave at 0 if unsure
Returns
- MtDti
The newly registered DTI