Struct RoleData
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
roleRoleTypeIdThe fake role.
authorityRoleData.AuthorityThe authority of the role data.
unitIdbyte?The fake UnitID, if
roleis an NTF role.customDataAction<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
None
Gets the static RoleData representing no data.
public static RoleData None { get; }
Property Value
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
otherRoleData
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Operators
operator ==(RoleData, RoleData)
Checks if 2 RoleData are equal.
public static bool operator ==(RoleData left, RoleData right)
Parameters
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
Returns
- bool
Whether the parameters are not equal.