mirror of
https://github.com/Relintai/mono.git
synced 2024-11-08 10:12:16 +01:00
48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
namespace GodotTools.IdeMessaging
|
|
{
|
|
public readonly struct GodotIdeMetadata
|
|
{
|
|
public int Port { get; }
|
|
public string EditorExecutablePath { get; }
|
|
|
|
public const string DefaultFileName = "ide_messaging_meta.txt";
|
|
|
|
public GodotIdeMetadata(int port, string editorExecutablePath)
|
|
{
|
|
Port = port;
|
|
EditorExecutablePath = editorExecutablePath;
|
|
}
|
|
|
|
public static bool operator ==(GodotIdeMetadata a, GodotIdeMetadata b)
|
|
{
|
|
return a.Port == b.Port && a.EditorExecutablePath == b.EditorExecutablePath;
|
|
}
|
|
|
|
public static bool operator !=(GodotIdeMetadata a, GodotIdeMetadata b)
|
|
{
|
|
return !(a == b);
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj is GodotIdeMetadata metadata)
|
|
return metadata == this;
|
|
|
|
return false;
|
|
}
|
|
|
|
public bool Equals(GodotIdeMetadata other)
|
|
{
|
|
return Port == other.Port && EditorExecutablePath == other.EditorExecutablePath;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
unchecked
|
|
{
|
|
return (Port * 397) ^ (EditorExecutablePath != null ? EditorExecutablePath.GetHashCode() : 0);
|
|
}
|
|
}
|
|
}
|
|
}
|