using System.Collections.Generic;
using System.Linq;

namespace Squadmania.Squad.Rcon.Parsers
{
    public class ListLevelsParser : ICommandParser<List<string>>
    {
        private const string Header = "List of available levels :";
        
        public List<string> Parse(
            string input
        )
        {
            input = input.Replace(Header, "")
                .Replace("\r\n", "\n");

            return input.Split("\n").ToList();
        }
    }
}