You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
825 B
32 lines
825 B
using ConsoleApp;
|
|
using Model;
|
|
using DataPersistence;
|
|
using Model.Managers;
|
|
|
|
Console.WriteLine("Hello, World!\n\n");
|
|
|
|
string path = ""; // - path to the save file
|
|
string strategy = "xml"; // - strategy is 'xml' or 'json' (/!\ this is case sensitive)
|
|
|
|
MasterManager masterMgr;
|
|
IDataManager dataManager = (strategy == "xml") ?
|
|
new DataContractXML(path)
|
|
: new DataContractJSON(path);
|
|
|
|
if (!File.Exists(Path.Combine(path, $"data.{strategy}")))
|
|
{
|
|
masterMgr = new MasterManager(new Stubs());
|
|
masterMgr.DataMgr.Serializer = dataManager;
|
|
}
|
|
else
|
|
{
|
|
masterMgr = new MasterManager(dataManager);
|
|
}
|
|
|
|
|
|
MenuManager menuMgr = new MenuManager(masterMgr);
|
|
menuMgr.Loop();
|
|
|
|
// Save data.
|
|
Console.Write("[ --SAVE-- ]:\t"); masterMgr.DataMgr.Save(); Console.WriteLine("Done.");
|