Compare commits

..

26 Commits

Author SHA1 Message Date
Tim Van Baak 7749d8df4e Remove reference from Unit.Past 2024-08-14 08:39:19 -07:00
Tim Van Baak 53e208ec31 Remove Location reference from Unit 2024-08-14 08:20:04 -07:00
Tim Van Baak ce25329d27 Refactor away Unit.Province 2024-08-14 08:15:10 -07:00
Tim Van Baak 4df5ef84dc Shift usage of Unit.Location to Unit.LocationId
This is in preparation for removing province and location references from Unit
2024-08-14 07:39:49 -07:00
Tim Van Baak 7400334a3d Always name locations 2024-08-14 06:55:40 -07:00
Tim Van Baak b2ff8896b2 Enable basic World serialization 2024-08-13 22:14:55 -07:00
Tim Van Baak c9bd8c8194 Delete Season.Coord 2024-08-13 18:56:21 -07:00
Tim Van Baak 5989970c42 Refactor timelines and season creation logic into World 2024-08-13 18:56:21 -07:00
Tim Van Baak cc2c29980a Add two more CLI verbs to implement 2024-08-13 18:56:21 -07:00
Tim Van Baak 984676f587 Add more JsonIgnores 2024-08-13 18:56:21 -07:00
Tim Van Baak fd8c725286 Store order history by timeline designation instead of reference 2024-08-12 21:58:24 -07:00
Tim Van Baak 0dec1e1eec Add a serialization round trip test
This currently fails because a lot of World still works on references instead of lookups
2024-08-12 21:47:28 -07:00
Tim Van Baak 27ffaccd20 Update Season ctor 2024-08-12 15:27:20 -07:00
Tim Van Baak b17ce9485a Refactor season futures into World 2024-08-12 15:25:23 -07:00
Tim Van Baak 3242186208 Use a simpler override where available 2024-08-12 14:57:16 -07:00
Tim Van Baak 11dfa403e4 Rename PastId back to Past 2024-08-12 14:52:50 -07:00
Tim Van Baak ae77c3c708 Remove Season.Past so all lookups go through World 2024-08-12 14:51:07 -07:00
Tim Van Baak f5afb4105b Move more timeline logic from Season to World 2024-08-12 14:50:15 -07:00
Tim Van Baak 7d4f7760be Move GetAdjacentSeasons to PathFinder 2024-08-12 14:12:49 -07:00
Tim Van Baak 5dfe9a5bb5 Replace most uses of Season creators to World 2024-08-12 13:56:06 -07:00
Tim Van Baak 5472dda931 Eliminate RootSeason field 2024-08-12 10:59:48 -07:00
Tim Van Baak 9696919773 Update timeline designator usage
Timelines are now identified by strings and come first in timeline-turn tuples.
2024-08-12 09:28:56 -07:00
Tim Van Baak 3d48a7d6f6 Refactor timeline factory to generate string ids
The strings are immediately shimmed back to ints for now
2024-08-12 07:51:18 -07:00
Tim Van Baak d7c07d1ff1 Add Makefile 2024-08-11 21:45:25 -07:00
Tim Van Baak dab37c239b Refactor province and power information into Map 2024-08-11 21:45:25 -07:00
Tim Van Baak 135997a7cd Add a real CLI for adjudication 2024-08-10 14:54:03 -07:00
5 changed files with 71 additions and 8 deletions

View File

@ -0,0 +1,15 @@
using CommandLine;
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)
{
throw new NotImplementedException();
}
}

View File

@ -0,0 +1,15 @@
using CommandLine;
namespace MultiversalDiplomacy.CommandLine;
[Verb("image", HelpText = "Generate an image of a game state.")]
public class ImageOptions
{
[Value(0, HelpText = "Input file describing the game state to visualize, or - to read from stdin.")]
public string? InputFile { get; set; }
public static void Execute(ImageOptions args)
{
throw new NotImplementedException();
}
}

View File

@ -0,0 +1,18 @@
using CommandLine;
namespace MultiversalDiplomacy.CommandLine;
[Verb("repl", HelpText = "Begin an interactive 5dplomacy session.")]
public class ReplOptions
{
[Option('i', "input", HelpText = "Begin the repl session by executing the commands in this file.")]
public string? InputFile { get; set; }
[Option('o', "output", HelpText = "Echo the repl session to this file. Specify a directory to autogenerate a filename.")]
public string? OutputFile { get; set; }
public static void Execute(ReplOptions args)
{
throw new NotImplementedException();
}
}

View File

@ -7,6 +7,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>MultiversalDiplomacyTests</_Parameter1>

View File

@ -1,12 +1,23 @@
using System;
using CommandLine;
namespace MultiversalDiplomacy
using MultiversalDiplomacy.CommandLine;
namespace MultiversalDiplomacy;
internal class Program
{
internal class Program
static void Main(string[] args)
{
static void Main(string[] args)
{
Console.WriteLine("stab");
}
var parser = Parser.Default;
var parseResult = parser.ParseArguments(
args,
typeof(AdjudicateOptions),
typeof(ImageOptions),
typeof(ReplOptions));
parseResult
.WithParsed<AdjudicateOptions>(AdjudicateOptions.Execute)
.WithParsed<ImageOptions>(ImageOptions.Execute)
.WithParsed<ReplOptions>(ReplOptions.Execute);
}
}
}