Search Results for

    Show / Hide Table of Contents

    Class Role

    Defines the class for role-related classes.

    Inheritance
    System.Object
    TypeCastObject<Role>
    Role
    FilmMakerRole
    FpcRole
    NoneRole
    Scp079Role
    SpectatorRole
    Implements
    IWrapper<PlayerRoles.PlayerRoleBase>
    Inherited Members
    TypeCastObject<Role>.Cast<TObject>()
    TypeCastObject<Role>.Cast<TObject>(TObject)
    TypeCastObject<Role>.As<TObject>()
    TypeCastObject<Role>.Is<TObject>(TObject)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Features.Roles
    Assembly: Exiled.API.dll
    Syntax
    public abstract class Role : TypeCastObject<Role>, IWrapper<PlayerRoleBase>

    Constructors

    | Improve this Doc View Source

    Role(PlayerRoleBase)

    Initializes a new instance of the Role class.

    Declaration
    protected Role(PlayerRoleBase baseRole)
    Parameters
    Type Name Description
    PlayerRoles.PlayerRoleBase baseRole

    the base PlayerRoles.PlayerRoleBase.

    Properties

    | Improve this Doc View Source

    ActiveTime

    Gets the last time the Role was active.

    Declaration
    public TimeSpan ActiveTime { get; }
    Property Value
    Type Description
    System.TimeSpan
    | Improve this Doc View Source

    Base

    Gets the base PlayerRoles.PlayerRoleBase.

    Declaration
    public PlayerRoleBase Base { get; }
    Property Value
    Type Description
    PlayerRoles.PlayerRoleBase
    | Improve this Doc View Source

    Color

    Gets the UnityEngine.Color of this Role.

    Declaration
    public Color Color { get; }
    Property Value
    Type Description
    UnityEngine.Color
    | Improve this Doc View Source

    IsAlive

    Gets a value indicating whether or not this role represents a living role.

    Declaration
    public bool IsAlive { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsDead

    Gets a value indicating whether or not this role represents a dead role.

    Declaration
    public bool IsDead { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsValid

    Gets a value indicating whether or not this role is still valid. This will only ever be false if the Role is stored and accessed at a later date.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Name

    Gets the Role full name.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Owner

    Gets the Player this role is referring to.

    Declaration
    public virtual Player Owner { get; }
    Property Value
    Type Description
    Player
    | Improve this Doc View Source

    RandomSpawnLocation

    Gets a random spawn position of this role.

    Declaration
    public virtual SpawnLocation RandomSpawnLocation { get; }
    Property Value
    Type Description
    SpawnLocation

    The spawn position.

    | Improve this Doc View Source

    Side

    Gets the Side of this Role.

    Declaration
    public Side Side { get; }
    Property Value
    Type Description
    Side
    | Improve this Doc View Source

    SpawnFlags

    Gets the PlayerRoles.RoleSpawnFlags.

    Declaration
    public RoleSpawnFlags SpawnFlags { get; }
    Property Value
    Type Description
    PlayerRoles.RoleSpawnFlags
    | Improve this Doc View Source

    SpawnReason

    Gets the PlayerRoles.RoleChangeReason.

    Declaration
    public RoleChangeReason SpawnReason { get; }
    Property Value
    Type Description
    PlayerRoles.RoleChangeReason
    | Improve this Doc View Source

    Team

    Gets the PlayerRoles.Team of this Role.

    Declaration
    public Team Team { get; }
    Property Value
    Type Description
    PlayerRoles.Team
    | Improve this Doc View Source

    Type

    Gets the PlayerRoles.RoleTypeId of this Player.

    Declaration
    public abstract RoleTypeId Type { get; }
    Property Value
    Type Description
    PlayerRoles.RoleTypeId

    Methods

    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()
    | Improve this Doc View Source

    Set(RoleTypeId, SpawnReason)

    Sets the player's PlayerRoles.RoleTypeId.

    Declaration
    public virtual void Set(RoleTypeId newRole, SpawnReason reason = SpawnReason.ForceClass)
    Parameters
    Type Name Description
    PlayerRoles.RoleTypeId newRole

    The new PlayerRoles.RoleTypeId to be set.

    SpawnReason reason

    The SpawnReason defining why the player's role was changed.

    | Improve this Doc View Source

    Set(RoleTypeId, SpawnReason, RoleSpawnFlags)

    Sets the player's PlayerRoles.RoleTypeId.

    Declaration
    public virtual void Set(RoleTypeId newRole, SpawnReason reason, RoleSpawnFlags spawnFlags)
    Parameters
    Type Name Description
    PlayerRoles.RoleTypeId newRole

    The new PlayerRoles.RoleTypeId to be set.

    SpawnReason reason

    The SpawnReason defining why the player's role was changed.

    PlayerRoles.RoleSpawnFlags spawnFlags

    The PlayerRoles.RoleSpawnFlags defining player spawn logic.

    | Improve this Doc View Source

    Set(RoleTypeId, RoleSpawnFlags)

    Sets the player's PlayerRoles.RoleTypeId.

    Declaration
    public virtual void Set(RoleTypeId newRole, RoleSpawnFlags spawnFlags)
    Parameters
    Type Name Description
    PlayerRoles.RoleTypeId newRole

    The new PlayerRoles.RoleTypeId to be set.

    PlayerRoles.RoleSpawnFlags spawnFlags

    The PlayerRoles.RoleSpawnFlags defining player spawn logic.

    | Improve this Doc View Source

    ToString()

    Returns the role in a human-readable format.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A string containing role-related data.

    Overrides
    System.Object.ToString()

    Operators

    | Improve this Doc View Source

    Equality(Role, Role)

    Returns whether or not 2 roles are the same.

    Declaration
    public static bool operator ==(Role left, Role right)
    Parameters
    Type Name Description
    Role left

    The role.

    Role right

    The other role.

    Returns
    Type Description
    System.Boolean

    true if the values are equal.

    | Improve this Doc View Source

    Equality(Role, RoleTypeId)

    Returns whether or not the role has the same RoleTypeId as the given typeId.

    Declaration
    public static bool operator ==(Role role, RoleTypeId typeId)
    Parameters
    Type Name Description
    Role role

    The Role.

    PlayerRoles.RoleTypeId typeId

    The PlayerRoles.RoleTypeId.

    Returns
    Type Description
    System.Boolean

    true if the values are equal.

    | Improve this Doc View Source

    Equality(RoleTypeId, Role)

    Returns whether or not the role has the same RoleTypeId as the given type.

    Declaration
    public static bool operator ==(RoleTypeId type, Role role)
    Parameters
    Type Name Description
    PlayerRoles.RoleTypeId type

    The PlayerRoles.RoleTypeId.

    Role role

    The Role.

    Returns
    Type Description
    System.Boolean

    true if the values are equal.

    | Improve this Doc View Source

    Implicit(Role to RoleTypeId)

    Converts a role to its appropriate PlayerRoles.RoleTypeId.

    Declaration
    public static implicit operator RoleTypeId(Role role)
    Parameters
    Type Name Description
    Role role

    The role.

    Returns
    Type Description
    PlayerRoles.RoleTypeId
    | Improve this Doc View Source

    Inequality(Role, Role)

    Returns whether or not the two roles are different.

    Declaration
    public static bool operator !=(Role left, Role right)
    Parameters
    Type Name Description
    Role left

    The role.

    Role right

    The other role.

    Returns
    Type Description
    System.Boolean

    true if the values are not equal.

    | Improve this Doc View Source

    Inequality(Role, RoleTypeId)

    Returns whether or not the role has a different RoleTypeId as the given typeId.

    Declaration
    public static bool operator !=(Role role, RoleTypeId typeId)
    Parameters
    Type Name Description
    Role role

    The Role.

    PlayerRoles.RoleTypeId typeId

    The PlayerRoles.RoleTypeId.

    Returns
    Type Description
    System.Boolean

    true if the values are not equal.

    | Improve this Doc View Source

    Inequality(RoleTypeId, Role)

    Returns whether or not the role has a different RoleTypeId as the given type.

    Declaration
    public static bool operator !=(RoleTypeId type, Role role)
    Parameters
    Type Name Description
    PlayerRoles.RoleTypeId type

    The PlayerRoles.RoleTypeId.

    Role role

    The Role.

    Returns
    Type Description
    System.Boolean

    true if the values are not equal.

    Implements

    IWrapper<T>

    Extension Methods

    ReflectionExtensions.CopyProperties(Object, Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX