using System;
using System.Collections.Generic;
using TheGameExtreme.model.card;
using TheGameExtreme.model.piles;

namespace TheGameExtreme.model.gameActions.abstractRules
{
    public abstract class TerminerSonTour : GameAction
    {
        protected TerminerSonTour(Piles ListOrderedStacks) : base(ListOrderedStacks)
        {
        }

        public abstract bool end(List<Card> CurrentHand, List<Card> CurrentCardPlayed);

        public bool Test(List<Card> CurrentHand)
        {
            if (CurrentHand.Count != 0)
            {
                List<Card> playableCard = new List<Card>();
                tryToFindSoluce(playableCard, CurrentHand);
                return testEndGame(playableCard);
            }
            return false;
        }

        protected abstract void tryToFindSoluce(List<Card> playableCard, List<Card> CurrentHand);

        protected abstract bool testEndGame(List<Card> playableCard);
    }
}
