using Engine.Scene;

namespace DoomDeathmatch.Component.UI;

public class MenuControllerComponent : Engine.Scene.Component.Component
{
  private readonly Dictionary<string, GameObject> _menuItems = new();

  public void AddMenuItem(string parName, GameObject parGameObject)
  {
    _menuItems.Add(parName, parGameObject);
  }

  public void RemoveMenuItem(string parName)
  {
    _menuItems.Remove(parName);
  }

  public void SelectMenuItem(string parName)
  {
    foreach (var (name, menuItem) in _menuItems)
    {
      menuItem.IsEnabled = name == parName;
    }
  }
}