Add a basic status command
This commit is contained in:
parent
36e2224324
commit
c5bd74ae1e
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue