using System.Collections.Generic;

namespace QCRPG.Framework;

public class DUTSpecificBuilder : BuilderBase
{
	private new PacketListBase packetList = new EmptyPacketList();

	private CommonConfigSettings commonConfigSettings = new CommonConfigSettings();

	public override void BuildTSL(PacketReceiveMode packetReceiveMode, bool deviceEmulationMode = false, int dutNumber = 1, bool commandLineMode = false, bool automationMode = false)
	{
		BuildTSL(packetReceiveMode, deviceEmulationMode, dutNumber, commandLineMode, automationMode);
	}

	public void BuildTSL(PacketReceiveMode packetReceiveMode, bool deviceEmulationMode = false, int dutNumber = 1, bool commandLineMode = false, bool automationMode = false, List<APIBase> apiList = null)
	{
		name = "DUT";
		dutName = "DUT" + dutNumber;
		logger = new Logger("  ", dutName);
		if (commandLineMode)
		{
			api = new DUTSpecificAPI(packetList, logger, packetReceiveMode, apiList);
			return;
		}
		configurer = new Configurer();
		api = new DUTSpecificAPI(packetList, logger, packetReceiveMode, apiList);
		gooier = new DUTSpecificGooier(name, logger, configurer, (DUTSpecificAPI)api, commonConfigSettings);
	}
}
