using System;

namespace QCRPG.Framework;

public struct UsbDeviceInfo
{
	public string path;

	public Type connectionClass;

	public string friendlyTypeIdentifier;

	public UsbDeviceInfo(string path, Type connectionClass)
	{
		this.path = path;
		this.connectionClass = connectionClass;
		friendlyTypeIdentifier = "";
	}

	public UsbDeviceInfo(string path, Type connectionClass, string friendlyTypeIdentifier)
	{
		this.path = path;
		this.connectionClass = connectionClass;
		this.friendlyTypeIdentifier = friendlyTypeIdentifier;
	}

	public override string ToString()
	{
		string text = path;
		while (text.Contains("\\"))
		{
			text = text.Remove(0, 1);
		}
		if (friendlyTypeIdentifier != "")
		{
			text = text + " (" + friendlyTypeIdentifier + ")";
		}
		return text;
	}
}
