Class RoleExtensions
A set of extensions for PlayerRoles.RoleTypeId.
Inheritance
Inherited Members
Namespace: Exiled.API.Extensions
Assembly: Exiled.API.dll
Syntax
public static class RoleExtensions
Methods
| Improve this Doc View SourceGetColor(RoleTypeId)
Gets a PlayerRoles.RoleTypeId UnityEngine.Color.
Declaration
public static Color GetColor(this RoleTypeId roleType)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId to get the color of. |
Returns
Type | Description |
---|---|
UnityEngine.Color | The UnityEngine.Color of the role. |
GetFullName(RoleTypeId)
Gets the full name of the given PlayerRoles.RoleTypeId.
Declaration
public static string GetFullName(this RoleTypeId typeId)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | typeId | The PlayerRoles.RoleTypeId. |
Returns
Type | Description |
---|---|
System.String | The full name. |
GetLeadingTeam(Team)
Gets the LeadingTeam.
Declaration
public static LeadingTeam GetLeadingTeam(this Team team)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.Team | team | Team. |
Returns
Type | Description |
---|---|
LeadingTeam |
GetRandomSpawnLocation(RoleTypeId)
Gets a random spawn point of a PlayerRoles.RoleTypeId.
Declaration
public static SpawnLocation GetRandomSpawnLocation(this RoleTypeId roleType)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId to get the spawn point from. |
Returns
Type | Description |
---|---|
SpawnLocation | Returns a SpawnLocation representing the spawn, or null if no spawns were found. |
GetRoleBase(RoleTypeId)
Gets the base PlayerRoles.PlayerRoleBase of the given PlayerRoles.RoleTypeId.
Declaration
public static PlayerRoleBase GetRoleBase(this RoleTypeId roleType)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId. |
Returns
Type | Description |
---|---|
PlayerRoles.PlayerRoleBase | The PlayerRoles.PlayerRoleBase. |
GetSide(RoleTypeId)
Gets a PlayerRoles.RoleTypeId Side.
Declaration
public static Side GetSide(this RoleTypeId roleType)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId to check the side of. |
Returns
Type | Description |
---|---|
Side | Side. |
GetSide(Team)
Gets a PlayerRoles.Team Side.
Declaration
public static Side GetSide(this Team team)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.Team | team | The PlayerRoles.Team to get the Side of. |
Returns
Type | Description |
---|---|
Side | Side. |
GetStartingAmmo(RoleTypeId)
Gets the starting ammo of a PlayerRoles.RoleTypeId.
Declaration
public static Dictionary<AmmoType, ushort> GetStartingAmmo(this RoleTypeId roleType)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<AmmoType, System.UInt16> | An System.Array of ItemType that the role receives on spawn. Will be empty for classes that do not spawn with ammo. |
GetStartingInventory(RoleTypeId)
Gets the starting items of a PlayerRoles.RoleTypeId.
Declaration
public static ItemType[] GetStartingInventory(this RoleTypeId roleType)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId. |
Returns
Type | Description |
---|---|
ItemType[] | An System.Array of ItemType that the role receives on spawn. Will be empty for classes that do not spawn with items. |
GetTeam(RoleTypeId)
Gets the PlayerRoles.Team of the given PlayerRoles.RoleTypeId.
Declaration
public static Team GetTeam(this RoleTypeId roleType)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId. |
Returns
Type | Description |
---|---|
PlayerRoles.Team | PlayerRoles.Team. |
IsFpcRole(RoleTypeId)
Checks whether a PlayerRoles.RoleTypeId is an PlayerRoles.FirstPersonControl.IFpcRole or not.
Declaration
public static bool IsFpcRole(this RoleTypeId roleType)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId. |
Returns
Type | Description |
---|---|
System.Boolean | Returns whether |
TryGetRoleBase(RoleTypeId, out PlayerRoleBase)
Tries to get the base PlayerRoles.PlayerRoleBase of the given PlayerRoles.RoleTypeId.
Declaration
public static bool TryGetRoleBase(this RoleTypeId roleType, out PlayerRoleBase roleBase)
Parameters
Type | Name | Description |
---|---|---|
PlayerRoles.RoleTypeId | roleType | The PlayerRoles.RoleTypeId. |
PlayerRoles.PlayerRoleBase | roleBase | The PlayerRoles.PlayerRoleBase to return. |
Returns
Type | Description |
---|---|
System.Boolean | The PlayerRoles.PlayerRoleBase. |