IUnitManagerService
A service for managing units.
Methods
GetPlayerUnit
Gets the unit of the specified player.
Parameters
| Name | Type | Description |
|---|---|---|
| player | FPlayer | A player. |
Returns
| Name | Type |
|---|---|
| Unit | The unit of the player. |
AddPlayerToUnit
Adds the player to the given unit.
Parameters
| Name | Type | Description |
|---|---|---|
| player | FPlayer | A player. |
| unit | Unit | A unit. |
RemovePlayerFromUnit
Removes a player from their unit.
Parameters
| Name | Type | Description |
|---|---|---|
| player | FPlayer | A player. |
EnablePanicMode
Enables panic mode for the given unit.
Parameters
| Name | Type | Description |
|---|---|---|
| unit | Unit | The unit. |
DisablePanicMode
Disables panic mode for the given unit.
Parameters
| Name | Type | Description |
|---|---|---|
| unit | Unit | The unit. |
CreateUnit
Parameters
| Name | Type | Description |
|---|---|---|
| callsign | string | The callsign of the player. |
| player | FPlayer | A player to add by default. |
Returns
| Name | Type |
|---|---|
| Unit | The created unit. |
CreateUnit
Creates a unit with the specified callsign and player.
Parameters
| Name | Type | Description |
|---|---|---|
| callsign | string | The callsign of the player. |
| players | IEnumerable<FPlayer> | The players to add by default. |
Returns
| Name | Type |
|---|---|
| Unit | The created unit. |
Events
OnUnitCreated
Invoked when a unit is created.
Type: EventHandler<Unit>
OnUnitRemoved
Invoked when a unit is removed.
Type: EventHandler<Unit>
OnPlayerJoinedUnit
Invoked when a player joined a unit.
Type: EventHandler<UnitPlayerEventArgs>
OnPlayerLeftUnit
Invoked when a player left a unit.
Type: EventHandler<UnitPlayerEventArgs>
OnPanicModeEnabled
Invoked when a unit has enabled the panic mode.
Type: EventHandler<Unit>
OnPanicModeDisabled
Invoked when a unit has disabled the panic mode.
Type: EventHandler<Unit>