I am trying to write some code that saves a name and set of records to a text file, and is able to be read and edited. I decided the best way to handle this was by creating a dictionary that held the string variable as the key and the three int variables as its values. However, I cannot get the specific code to work. It says that it cannot hold three values, despite it being declared a list. I have attached the code snippet below. It says the error occurs at the {playerwins, computerwins, ties} part of the dictionary.
private void FileWriter(string playername, int playerwins, int computerwins, int ties)
{
Dictionary<string, List<int>> records = new Dictionary<string, List<int>>()
{
{playername, {playerwins, computerwins, ties } };
}