using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using UnityEngine;
using Enums;

namespace Services.Interfaces {
    public interface IMatchService {
        HashSet<Gem> CurrentMatches { get; }
        /// <summary>
        /// Get positions of all matches that are not protected.
        /// </summary>
        /// <param name="protectedPositions">
        /// Protected positions, bombs that we don't want to destroy.
        /// </param>
        /// <returns>
        /// HashSet of unprotected matches.
        /// </returns>
        UniTask<HashSet<Vector2Int>> GetMatchPositionsAsync(List<Vector2Int> protectedPositions);
        
        /// <summary>
        /// Checks if there are any matches at the given position and type.
        /// </summary>
        /// <param name="positionToCheck">
        /// Position on the gameBoard to check.
        /// </param>
        /// <param name="gemTypeToCheck">
        /// Type of gem to check.
        /// </param>
        /// <returns>
        /// True if there are matches, false otherwise.
        /// </returns>
        bool MatchesAt(Vector2Int positionToCheck, GemType gemTypeToCheck);
        void FindAllMatches();
    }
}