Struct GameEntityId
Stable identifier for a gameplay entity.
Immutable value object that supports equality comparison and hashing.
Assembly: Serenity.GameplayEntity.Domain.dll
Syntax
public readonly struct GameEntityId : IEquatable<GameEntityId>
Constructors
GameEntityId(string)
Creates a new GameEntityId with the specified identifier.
Declaration
public GameEntityId(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
The unique string identifier. Cannot be null.
|
Fields
Value
The unique string identifier for this entity.
Declaration
public readonly string Value
Field Value
Properties
IsValid
Checks if this GameEntityId has a valid, non-empty value.
Declaration
public bool IsValid { get; }
Property Value
Methods
Equals(GameEntityId)
Declaration
public bool Equals(GameEntityId other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
NewGuid()
Creates a new GameEntityId with an auto-generated GUID.
Declaration
public static GameEntityId NewGuid()
Returns
| Type |
Description |
| GameEntityId |
A new GameEntityId with a unique GUID-based identifier.
|
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(GameEntityId, GameEntityId)
Declaration
public static bool operator ==(GameEntityId left, GameEntityId right)
Parameters
Returns
explicit operator GameEntityId(string)
Declaration
public static explicit operator GameEntityId(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
Returns
implicit operator string(GameEntityId)
Declaration
public static implicit operator string(GameEntityId id)
Parameters
Returns
operator !=(GameEntityId, GameEntityId)
Declaration
public static bool operator !=(GameEntityId left, GameEntityId right)
Parameters
Returns
Implements