Search Results for

    Show / Hide Table of Contents

    Class RoleExtensions

    A set of extensions for PlayerRoles.RoleTypeId.

    Inheritance
    System.Object
    RoleExtensions
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Extensions
    Assembly: Exiled.API.dll
    Syntax
    public static class RoleExtensions

    Methods

    | Improve this Doc View Source

    GetColor(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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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

    LeadingTeam.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 roleType is an PlayerRoles.FirstPersonControl.IFpcRole or not.

    | Improve this Doc View Source

    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.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX