using MoreLinq;
using StubCore.Entities;

namespace StubCore.Plugins.DataCollector
{
    public class ProfilesCollector : FrontCollector
    {

        private readonly string sourceName;
        private readonly string profilesFolder;

        public ProfilesCollector(string name, string folder) : base(name, folder)
        {
            sourceName = name;
            profilesFolder = folder;
        }

        public int GetLastID()
        {
            var lastID = 0;
            var _list = GetFiles<Profile>();

            if (_list.Count > 0)
            {
                lastID = _list.MaxBy(profile => profile.id).id;
            }
            else
            {
                _logger.IndexListZero();
            }

            return lastID;
        }        
    }
}
