From f61982d91ef2f1dfa626e9f6eab53594cbfc1431 Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Sat, 31 Dec 2022 13:53:07 -0800 Subject: [PATCH] Add subcommands to new --- .../Script/ReplScriptHandler.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/MultiversalDiplomacy/Script/ReplScriptHandler.cs b/MultiversalDiplomacy/Script/ReplScriptHandler.cs index 1bb4895..37d2622 100644 --- a/MultiversalDiplomacy/Script/ReplScriptHandler.cs +++ b/MultiversalDiplomacy/Script/ReplScriptHandler.cs @@ -30,10 +30,22 @@ public class ReplScriptHandler : IScriptHandler Console.WriteLine("stab"); break; - case "new": - var world = GameController.InitializeWorld(); + case "new" when args.Length == 1: + 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); - 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; default: