an_toni.a
08/29/2024, 6:33 AMan_toni.a
08/29/2024, 6:36 AMan_toni.a
08/29/2024, 6:38 AMan_toni.a
08/29/2024, 6:51 AMcsharp
public readonly struct TypedEntityId<TTag> : IEquatable<TypedEntityId<TTag>>
{
public EntityId Value { get; }
private TypedEntityId(EntityId value)
{
Value = value;
}
public static implicit operator EntityId(TypedEntityId<TTag> typed) => typed.Value;
public static explicit operator TypedEntityId<TTag>(EntityId entityId) => new TypedEntityId<TTag>(entityId);
public bool Equals(TypedEntityId<TTag> other) => Value.Equals(other.Value);
public override bool Equals(object obj) => obj is TypedEntityId<TTag> other && Equals(other);
public override int GetHashCode() => Value.GetHashCode();
public override string ToString() => Value.ToString();
}
public struct PlayerId : TypedEntityId<IPlayerIdTag>
{
public PlayerId(EntityId entityId) : base(entityId) {}
public static PlayerId Create(ulong value) => new PlayerId(EntityId.Create(EntityKindCore.Player, value));
}Jurjen
08/29/2024, 7:59 AMan_toni.a
08/29/2024, 8:41 AMan_toni.a
08/29/2024, 8:41 AMJurjen
08/29/2024, 8:43 AM