using System;
using UnityEngine;

public static class Events
{
    #region Buildings
    public static void BuildingSelected(BuildingData data) => OnBuildingSelected?.Invoke(data);
    public static event Action<BuildingData> OnBuildingSelected;
    public static void BuildingDeselected() => OnBuildingDeselected?.Invoke();
    public static event Action OnBuildingDeselected;
    #endregion

    #region Cards
    public static void CardForMovingSelected(Building selectedBuilding, Card selectedCard) => OnCardForMovingSelected?.Invoke(selectedBuilding, selectedCard);
    public static event Action<Building, Card> OnCardForMovingSelected;
    public static void AddCard(Card card) => OnAddCard?.Invoke(card);
    public static event Action<Card> OnAddCard;
    public static void RemoveCard(Card card) => OnRemoveCard?.Invoke(card);
    public static event Action<Card> OnRemoveCard;
    public static void RemoveCards(CardType cardType, int amount) => OnRemoveCards?.Invoke(cardType, amount);
    public static event Action<CardType, int> OnRemoveCards;
    public static void PlaceCard(Card card) => OnPlaceCard?.Invoke(card);
    public static event Action<Card> OnPlaceCard;
    #endregion

    #region People & Houses
    public static void AddPeople(int amount) => OnAddPeople?.Invoke(amount);
    public static event Action<int> OnAddPeople;
    public static void RemovePeople(int amount) => OnRemovePeople?.Invoke(amount);
    public static event Action<int> OnRemovePeople;
    public static void AddHome(int amount) => OnAddHome?.Invoke(amount);
    public static event Action<int> OnAddHome;
    public static void RemoveHome(int amount) => OnRemoveHome?.Invoke(amount);
    public static event Action<int> OnRemoveHome;
    #endregion

    public static void DayStart() => OnDayStart?.Invoke();
    public static event Action OnDayStart;
    public static void DayEnd() => OnDayEnd?.Invoke();
    public static event Action OnDayEnd;

    public static void GameStart() => OnGameStart?.Invoke();
    public static event Action OnGameStart;
    public static void GameEnd() => OnGameEnd?.Invoke();
    public static event Action OnGameEnd;

    public static void ShowTooltip(BuildingData buildingData, Vector3 position) => OnShowTooltip?.Invoke(buildingData, position);
    public static event Action<BuildingData, Vector3> OnShowTooltip;
    public static void HideTooltip() => OnHideTooltip?.Invoke();
    public static event Action OnHideTooltip;
}
