using Decal.Interop.Filters;

namespace Decal.Adapter.Wrappers;

/// <summary>
/// Defines the WorldObjectCollection filter for objects of the same type/class
/// </summary>
public class ByObjectClassFilter : WorldObjectCollectionFilter
{
	private ObjectClass objClass;

	/// <summary>
	/// Class of the items in this collection
	/// </summary>
	public ObjectClass ObjectClass
	{
		get
		{
			return objClass;
		}
		set
		{
			objClass = value;
		}
	}

	/// <summary>
	/// Creates a new filter
	/// </summary>
	public ByObjectClassFilter()
	{
	}

	/// <summary>
	/// Creates a new filter using the specified ObjectClass
	/// </summary>
	/// <param name="objClass">Class of the items</param>
	public ByObjectClassFilter(ObjectClass objClass)
	{
		this.objClass = objClass;
	}

	internal override void ApplyFilter(WorldIterator wi)
	{
		wi.ByObjectClass((eObjectClass)objClass);
	}

	internal override void ApplyFilter(Decal.Interop.Filters.Vendor ven)
	{
		ven.ByObjectClass((eObjectClass)objClass);
	}
}
