Table of Contents

Struct RoleData

Namespace
Exiled.API.Structs
Assembly
Exiled.API.dll

A struct representing all data regarding a fake role.

public struct RoleData : IEquatable<RoleData>
Implements
Inherited Members
Extension Methods

Constructors

RoleData(RoleTypeId, Authority, byte?, Action<NetworkWriter>)

Initializes a new instance of the RoleData struct.

public RoleData(RoleTypeId role = RoleTypeId.None, RoleData.Authority authority = Authority.None, byte? unitId = null, Action<NetworkWriter> customData = null)

Parameters

role RoleTypeId

The fake role.

authority RoleData.Authority

The authority of the role data.

unitId byte?

The fake UnitID, if role is an NTF role.

customData Action<NetworkWriter>

An action used to write custom data if this role data is used to send a fake role. For 99% of uses, just leave this as null.

Properties

CustomData

Gets or sets custom data written to network writers when fake data is generated.

public Action<NetworkWriter> CustomData { readonly get; set; }

Property Value

Action<NetworkWriter>

Remarks

Leave this value as null unless you are writing custom role-specific data.

DataAuthority

Gets or sets the authority of this RoleData instance. see RoleData.Authority for details.

public RoleData.Authority DataAuthority { readonly get; set; }

Property Value

RoleData.Authority

None

Gets the static RoleData representing no data.

public static RoleData None { get; }

Property Value

RoleData

Role

Gets or sets the fake role.

public RoleTypeId Role { readonly get; set; }

Property Value

RoleTypeId

UnitId

Gets or sets the UnitID of the fake role, if Role is an NTF role.

public byte? UnitId { readonly get; set; }

Property Value

byte?

Methods

Equals(RoleData)

public bool Equals(RoleData other)

Parameters

other RoleData

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(RoleData, RoleData)

Checks if 2 RoleData are equal.

public static bool operator ==(RoleData left, RoleData right)

Parameters

left RoleData

A RoleData.

right RoleData

The other RoleData.

Returns

bool

Whether the parameters are equal.

operator !=(RoleData, RoleData)

Checks if 2 RoleData are not equal.

public static bool operator !=(RoleData left, RoleData right)

Parameters

left RoleData

A RoleData.

right RoleData

The other RoleData.

Returns

bool

Whether the parameters are not equal.