mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-27 05:58:07 +03:00
Merge pull request #541 from morga4/master
Override connection's GetHashCode()
This commit is contained in:
commit
57d0e40ebb
@ -16,9 +16,13 @@ namespace Steamworks.Data
|
|||||||
public uint Id { get; set; }
|
public uint Id { get; set; }
|
||||||
|
|
||||||
public bool Equals( Connection other ) => Id == other.Id;
|
public bool Equals( Connection other ) => Id == other.Id;
|
||||||
|
public override bool Equals( object obj ) => obj is Connection other && Id == other.Id;
|
||||||
|
public override int GetHashCode() => Id.GetHashCode();
|
||||||
public override string ToString() => Id.ToString();
|
public override string ToString() => Id.ToString();
|
||||||
public static implicit operator Connection( uint value ) => new Connection() { Id = value };
|
public static implicit operator Connection( uint value ) => new Connection() { Id = value };
|
||||||
public static implicit operator uint( Connection value ) => value.Id;
|
public static implicit operator uint( Connection value ) => value.Id;
|
||||||
|
public static bool operator ==( Connection value1, Connection value2 ) => value1.Equals(value2);
|
||||||
|
public static bool operator !=( Connection value1, Connection value2 ) => !value1.Equals(value2);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Accept an incoming connection that has been received on a listen socket.
|
/// Accept an incoming connection that has been received on a listen socket.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user