Class UnitManager
- Namespace
- SharpPluginLoader.Core
- Assembly
- SharpPluginLoader.Core.dll
The core unit manager of the game. See Unit for more information about units.
public static class UnitManager
- Inheritance
-
UnitManager
- Inherited Members
Properties
LineCount
The number of lines in use.
public static uint LineCount { get; }
Property Value
SingletonInstance
public static MtObject? SingletonInstance { get; }
Property Value
UnitGroupCount
The number of unit groups in use.
public static uint UnitGroupCount { get; }
Property Value
Methods
AddBottom(Unit, int, ulong)
Registers at the bottom of a line. Prefer this function over AddTop(Unit, int, ulong) for non-monster and non-player units.
public static bool AddBottom(Unit unit, int line, ulong groupBit)
Parameters
unitUnitThe unit to register.
lineintThe line to register the unit in.
groupBitulongThe group bit of the unit.
Returns
- bool
True if the unit was registered, otherwise false.
AddTop(Unit, int, ulong)
Registers at the top of a line.
public static bool AddTop(Unit unit, int line, ulong groupBit)
Parameters
unitUnitThe unit to register.
lineintThe line to register the unit in.
groupBitulongThe group bit of the unit.
Returns
- bool
True if the unit was registered, otherwise false.
Remarks
Generally only monsters and players should be registered using this function. For other units, use AddBottom(Unit, int, ulong).
GetLine(int)
Gets a line by its index.
public static MoveLine? GetLine(int index)
Parameters
Returns
- MoveLine
The line
NewUnit(MtDti)
Creates a new instance of a unit.
public static Unit? NewUnit(MtDti dti)
Parameters
dtiMtDtiThe dti of the unit.
Returns
- Unit
The new unit.
Remarks
This function does not register the unit in a line. You must do that manually.
NewUnit<T>(MtDti)
Creates a new instance of a unit.
public static T? NewUnit<T>(MtDti dti) where T : Unit
Parameters
dtiMtDtiThe dti of the unit.
Returns
- T
The new unit.
Type Parameters
TThe type of the unit.
Remarks
This function does not register the unit in a line. You must do that manually.