using System;
using System.IO;

namespace Katteker.AppStub
{
    public class AppEntry : IComparable<AppEntry>
    {
        public AppEntry(DirectoryInfo info)
        {
            DirInfo = info;
            Version = SemanticVersion.Parse(info.Name.Replace("app-", ""));
        }

        public SemanticVersion Version { get; }
        public DirectoryInfo DirInfo { get; }

        public int CompareTo(AppEntry other) => Version.CompareTo(other.Version);
    }
}