Client LuaCsForBarotrauma
Endpoint.cs
1 #nullable enable
2 
3 namespace Barotrauma.Networking
4 {
5  abstract class Endpoint
6  {
7  public abstract string StringRepresentation { get; }
8 
9  public abstract LocalizedString ServerTypeString { get; }
10 
11  public readonly Address Address;
12 
13  public Endpoint(Address address)
14  {
15  Address = address;
16  }
17 
18  public abstract override bool Equals(object? obj);
19 
20  public abstract override int GetHashCode();
21 
22  public override string ToString() => StringRepresentation;
23 
24  public static Option<Endpoint> Parse(string str)
25  => ReflectionUtils.ParseDerived<Endpoint, string>(str);
26 
27  public static bool operator ==(Endpoint? a, Endpoint? b)
28  {
29  if (a is null)
30  {
31  return b is null;
32  }
33  else
34  {
35  return a.Equals(b);
36  }
37  }
38 
39  public static bool operator !=(Endpoint? a, Endpoint? b)
40  => !(a == b);
41  }
42 }
abstract LocalizedString ServerTypeString
Definition: Endpoint.cs:9
abstract override int GetHashCode()
static bool operator==(Endpoint? a, Endpoint? b)
Definition: Endpoint.cs:27
override string ToString()
static Option< Endpoint > Parse(string str)
readonly Address Address
Definition: Endpoint.cs:11
abstract string StringRepresentation
Definition: Endpoint.cs:7
Endpoint(Address address)
Definition: Endpoint.cs:13
abstract override bool Equals(object? obj)
static bool operator!=(Endpoint? a, Endpoint? b)