using System.Collections.Generic;

namespace QFDT;

internal class ProductSearch
{
	private List<ProductID> ProductList = new List<ProductID>();

	public void AddProduct(string ProductName, string MPSS_version, int RFHWID)
	{
		ProductID item = new ProductID(ProductName, MPSS_version, RFHWID);
		ProductList.Add(item);
	}

	public string SearchProduct(string version, int RFHWID)
	{
		string result = "";
		for (int i = 0; i < ProductList.Count; i++)
		{
			if (ProductList[i].IsMatch(version, RFHWID))
			{
				result = ProductList[i].m_productName;
				break;
			}
		}
		return result;
	}
}
