using QwirkleClassLibrary.Boards;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace QwirkleClassLibrary.Players
{
    [DataContract]
    public class Score
    {
        [DataMember]
        public string PlayerName { get; private set; }
        
        [DataMember]
        public DateTime Date { get; set; }
        
        [DataMember]
        public int Points { get; set; }
        
        [DataMember]
        public int Victories { get; set; }

        /// <summary>
        /// Creates a score with the player's name, the date of the score, the number of points and the number of victories
        /// </summary>
        /// <param name="playerName"></param>
        /// <param name="date"></param>
        /// <param name="points"></param>
        /// <param name="victories"></param>
        public Score(string playerName, DateTime date, int points, int victories)
        {
            PlayerName = playerName;
            Date = date;
            Points = points;
            Victories = victories;
        }

        /// <summary>
        /// Overrides the ToString method to display the player's name, the date of the score, the number of points and the number of victories
        /// </summary>
        /// <returns>string</returns>
        public override string ToString()
        {
            return PlayerName + " / " + Date.ToString() + " / " + Points + " / " + Victories;
        }
    }

}
