Table of Contents

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

uint

SingletonInstance

public static MtObject? SingletonInstance { get; }

Property Value

MtObject

UnitGroupCount

The number of unit groups in use.

public static uint UnitGroupCount { get; }

Property Value

uint

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

unit Unit

The unit to register.

line int

The line to register the unit in.

groupBit ulong

The 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

unit Unit

The unit to register.

line int

The line to register the unit in.

groupBit ulong

The 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

index int

The index of the line. Can be between 0 and LineCount - 1.

Returns

MoveLine

The line

NewUnit(MtDti)

Creates a new instance of a unit.

public static Unit? NewUnit(MtDti dti)

Parameters

dti MtDti

The 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

dti MtDti

The dti of the unit.

Returns

T

The new unit.

Type Parameters

T

The type of the unit.

Remarks

This function does not register the unit in a line. You must do that manually.