Compare commits

..

24 Commits

Author SHA1 Message Date
Tim Van Baak 5ad57465d8 Remove reference from Unit.Past 2024-08-14 09:06:05 -07:00
Tim Van Baak 885628900b Remove Location reference from Unit 2024-08-14 09:06:05 -07:00
Tim Van Baak e1772ce60b Refactor away Unit.Province 2024-08-14 09:06:05 -07:00
Tim Van Baak abaa7f7a92 Shift usage of Unit.Location to Unit.LocationId
This is in preparation for removing province and location references from Unit
2024-08-14 09:06:04 -07:00
Tim Van Baak 442015b942 Always name locations 2024-08-14 09:06:04 -07:00
Tim Van Baak 228ad53cca Enable basic World serialization 2024-08-14 09:06:04 -07:00
Tim Van Baak f1563b8f5f Delete Season.Coord 2024-08-14 09:06:04 -07:00
Tim Van Baak 345d54f960 Refactor timelines and season creation logic into World 2024-08-14 09:06:04 -07:00
Tim Van Baak 58f877425a Add more JsonIgnores 2024-08-14 09:06:04 -07:00
Tim Van Baak 2f4c8b2a38 Store order history by timeline designation instead of reference 2024-08-14 09:06:04 -07:00
Tim Van Baak ef4e130dbb Add a serialization round trip test
This currently fails because a lot of World still works on references instead of lookups
2024-08-14 09:06:04 -07:00
Tim Van Baak 9606307e12 Update Season ctor 2024-08-14 09:06:04 -07:00
Tim Van Baak 87685ec744 Refactor season futures into World 2024-08-14 09:06:04 -07:00
Tim Van Baak 752a898123 Use a simpler override where available 2024-08-14 09:06:04 -07:00
Tim Van Baak 400263ea0b Rename PastId back to Past 2024-08-14 09:06:04 -07:00
Tim Van Baak 5e5483367d Remove Season.Past so all lookups go through World 2024-08-14 09:06:04 -07:00
Tim Van Baak 81c9aa4859 Move more timeline logic from Season to World 2024-08-14 09:06:04 -07:00
Tim Van Baak fca8b77a21 Move GetAdjacentSeasons to PathFinder 2024-08-14 09:06:04 -07:00
Tim Van Baak b756959b0a Replace most uses of Season creators to World 2024-08-14 09:06:04 -07:00
Tim Van Baak b887e01334 Eliminate RootSeason field 2024-08-14 09:06:04 -07:00
Tim Van Baak 421e84b559 Update timeline designator usage
Timelines are now identified by strings and come first in timeline-turn tuples.
2024-08-14 09:06:04 -07:00
Tim Van Baak 780ae8b948 Refactor timeline factory to generate string ids
The strings are immediately shimmed back to ints for now
2024-08-14 09:06:03 -07:00
Tim Van Baak 40254b0fca Add Makefile 2024-08-14 09:04:56 -07:00
Tim Van Baak bd8e0da6b6 Refactor province and power information into Map 2024-08-14 09:04:56 -07:00
5 changed files with 8 additions and 71 deletions

View File

@ -1,15 +0,0 @@
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

@ -1,15 +0,0 @@
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

@ -1,18 +0,0 @@
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,10 +7,6 @@
<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,23 +1,12 @@
using CommandLine;
using System;
using MultiversalDiplomacy.CommandLine;
namespace MultiversalDiplomacy;
internal class Program
namespace MultiversalDiplomacy
{
static void Main(string[] args)
internal class Program
{
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);
static void Main(string[] args)
{
Console.WriteLine("stab");
}
}
}
}