using System.Collections.Generic;
using OrderStacks.model.gameActions.abstractRules;

namespace OrderStacks.model
{
    public class Parametreur
    {

        public GameMode GameMode { get; set; }
        public List<Player> players = new List<Player>();
        public int NbPlayer { get; set; }

        public Parametreur(GameMode gameMode)
        {
            GameMode = gameMode;
        }

        public void Prepare()
        {
            NbPlayer = players.Count;
            GameMode.load(NbPlayer, players);
        }

        public void AddPlayer(Player player)
        {
            if (player != null)
            {
                players.Add(player);
            }
        }

        public string getScore()
        {
            int score = GameMode.getScore();
            players.ForEach(player =>
            {
                score += player.getCardList().Count;
            });
            return score.ToString();
        }
    }
}
