using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Serialization;

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class Input : IEquatable<Input>
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private List<InputItem> inpField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private List<ArrayInputItem> arrInField;

	[XmlElement("In")]
	public List<InputItem> Inputs
	{
		get
		{
			return inpField;
		}
		set
		{
			inpField = value;
		}
	}

	[XmlElement("ArrIn")]
	public List<ArrayInputItem> ArrayInputs
	{
		get
		{
			return arrInField;
		}
		set
		{
			arrInField = value;
		}
	}

	public bool ShouldSerializeInputs()
	{
		if (Inputs != null)
		{
			return Inputs.Count > 0;
		}
		return false;
	}

	public bool ShouldSerializeArrayInputs()
	{
		if (ArrayInputs != null)
		{
			return ArrayInputs.Count > 0;
		}
		return false;
	}

	public Input()
	{
		inpField = new List<InputItem>();
		arrInField = new List<ArrayInputItem>();
	}

	public Input(List<InputItem> inp = null, List<ArrayInputItem> arrIn = null)
	{
		if (inp != null)
		{
			inpField = inp;
		}
		else
		{
			inpField = new List<InputItem>();
		}
		if (arrIn != null)
		{
			arrInField = arrIn;
		}
		else
		{
			arrInField = new List<ArrayInputItem>();
		}
	}

	public bool Equals(Input other)
	{
		bool result = false;
		if (Inputs.Count == other.Inputs.Count && ArrayInputs.Count == other.ArrayInputs.Count)
		{
			foreach (InputItem input in Inputs)
			{
				if (!other.Inputs.Contains(input))
				{
					return result;
				}
			}
			foreach (ArrayInputItem arrayInput in ArrayInputs)
			{
				if (!other.ArrayInputs.Contains(arrayInput))
				{
					return result;
				}
			}
			result = true;
		}
		return result;
	}
}
