5dplomacy/MultiversalDiplomacy/CommandLine/AdjudicateOptions.cs

27 lines
804 B
C#
Raw Normal View History

2024-08-14 15:44:22 +00:00
using System.Text.Json;
2024-08-10 21:54:03 +00:00
using CommandLine;
2024-08-14 15:44:22 +00:00
using MultiversalDiplomacy.Model;
2024-08-10 21:54:03 +00:00
namespace MultiversalDiplomacy.CommandLine;
[Verb("adjudicate", HelpText = "Adjudicate a Multiversal Diplomacy game state.")]
public class AdjudicateOptions
{
[Value(0, HelpText = "Input file describing the game state to adjudicate, or - to read from stdin.")]
public string? InputFile { get; set; }
public static void Execute(AdjudicateOptions args)
{
2024-08-14 15:44:22 +00:00
Stream input = args.InputFile switch {
null => Console.OpenStandardInput(),
"-" => Console.OpenStandardInput(),
_ => new FileStream(args.InputFile!, FileMode.Open, FileAccess.Read),
};
var state = JsonSerializer.Deserialize<World>(input);
2024-08-10 21:54:03 +00:00
throw new NotImplementedException();
}
}