Add subcommands to new

This commit is contained in:
Jaculabilis 2022-12-31 13:53:07 -08:00 committed by Tim Van Baak
parent 73a8934201
commit 79cfbc2666
1 changed files with 15 additions and 3 deletions

View File

@ -30,10 +30,22 @@ public class ReplScriptHandler : IScriptHandler
Console.WriteLine("stab"); Console.WriteLine("stab");
break; break;
case "new": case "new" when args.Length == 1:
var world = GameController.InitializeWorld(); Console.WriteLine("usage:");
Console.WriteLine(" new blank: standard map, no units");
Console.WriteLine(" new standard: standard map, standard units");
break;
case "new" when args[1] == "blank":
var world = MultiversalDiplomacy.Model.World.WithStandardMap();
var handler = new GameScriptHandler(world); var handler = new GameScriptHandler(world);
Console.WriteLine("Started a new game"); Console.WriteLine("Created an empty game");
return handler;
case "new" when args[1] == "standard":
world = GameController.InitializeWorld();
handler = new GameScriptHandler(world);
Console.WriteLine("Created a standard game");
return handler; return handler;
default: default: