0b94203a79
This will be used for communicating between the Godot editor and external IDEs/editors, for things like opening files, triggering hot-reload and running the game with a debugger attached.
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
namespace GodotTools.IdeConnection
|
|
{
|
|
public struct GodotIdeMetadata
|
|
{
|
|
public int Port { get; }
|
|
public string EditorExecutablePath { get; }
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|