using System.Collections.Generic;
using UnityEngine;

public class CardDetailFilterCategory : MonoBehaviour
{
	[SerializeField]
	private UILabel _categoryName;

	[SerializeField]
	private UIGrid _grid;

	public List<CardDetailFilterKeyWord> AllKeyWord { get; private set; }

	private void Awake()
	{
		AllKeyWord = new List<CardDetailFilterKeyWord>();
	}

	public void Initialize(string name)
	{
		_categoryName.text = name;
	}

	public void Reset()
	{
		foreach (CardDetailFilterKeyWord item in AllKeyWord)
		{
			item.Reset();
		}
	}

	public void AddChild(CardDetailFilterKeyWord keyword)
	{
		keyword.transform.parent = _grid.transform;
		keyword.transform.localScale = Vector3.one;
		_grid.Reposition();
		AllKeyWord.Add(keyword);
	}
}
