using DataContractPersistence;
using Models.Game;

namespace Trek_12
{
    public partial class App : Application
    {
        public string FileName { get; set; } = "data.json";
            
        public string FilePath { get; set; } = Path.Combine(AppDomain.CurrentDomain.BaseDirectory);

        public Game Manager { get; private set; }
        
        public App()
        {
            InitializeComponent();
            
            if(File.Exists(Path.Combine(FilePath, FileName)))
            {
                Manager = new Game(new DataContractJson());
            }
            
            Manager.LoadData();

            MainPage = new AppShell();
        }
    }
}
