new command-line option "--bank <filename>" can be specified to be used instead of the game config option
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Game.Data;
|
|
using Game.UI;
|
|
|
|
namespace Game {
|
|
internal class Program {
|
|
static int Main(string[] args) {
|
|
CommandLineOptions opts = CommandLineOptions.Parse(args);
|
|
|
|
TextDisplay display = new TextDisplay();
|
|
if (!display.InitWindow()) {
|
|
return 1;
|
|
}
|
|
display.PrintSimpleWelcome();
|
|
Thread.Sleep(1200);
|
|
display.ShowSplash();
|
|
Thread.Sleep(2500);
|
|
|
|
GameConfig gameConfig;
|
|
try {
|
|
GameConfig? existingGameConfig = GameFiles.ReadGameConfig();
|
|
if (existingGameConfig == null) {
|
|
gameConfig = GameFiles.CreateDefaultGameConfig();
|
|
} else {
|
|
gameConfig = existingGameConfig;
|
|
}
|
|
} catch {
|
|
display.ShowFatalError("Произошла неизвестная ошибка при чтении/создании файла настроек");
|
|
Console.ReadKey();
|
|
return 2;
|
|
}
|
|
|
|
string databaseFileName = opts.databaseFilename ?? gameConfig.databasePath;
|
|
|
|
display.ResetWindow();
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
} |