Add a basic status command

This commit is contained in:
Jaculabilis 2023-04-04 20:54:53 -07:00 committed by Tim Van Baak
parent 36e2224324
commit c5bd74ae1e
1 changed files with 12 additions and 0 deletions

View File

@ -32,6 +32,7 @@ public class GameScriptHandler : IScriptHandler
Console.WriteLine("commands:"); Console.WriteLine("commands:");
Console.WriteLine(" list: list things in a game category"); Console.WriteLine(" list: list things in a game category");
Console.WriteLine(" orders: submit order sets"); Console.WriteLine(" orders: submit order sets");
Console.WriteLine(" status: overview of the state of the game");
break; break;
case "list" when args.Length == 1: case "list" when args.Length == 1:
@ -70,6 +71,17 @@ public class GameScriptHandler : IScriptHandler
Console.WriteLine("Unrecognized power"); Console.WriteLine("Unrecognized power");
break; break;
case "status":
foreach (Season season in World.Seasons)
{
Console.WriteLine($"{season}");
foreach (Unit unit in World.Units.Where(u => u.Season == season))
{
Console.WriteLine($" {unit}");
}
}
break;
default: default:
Console.WriteLine("Unrecognized command"); Console.WriteLine("Unrecognized command");
break; break;