Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

feat(sim): scaffold solution, sim library, tests and CLI

eyalgolanbd87f2c9ff5a
diff --git a/.gitignore b/.gitignore
index 96beb8a75..37e200ef5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@ promo/preview/
promo/*.log
.DS_Store
.worktrees/
+sim/**/bin/
+sim/**/obj/
diff --git a/sim/Directory.Build.props b/sim/Directory.Build.props
new file mode 100644
index 000000000..781f079c5
--- /dev/null
+++ b/sim/Directory.Build.props
@@ -0,0 +1,7 @@
+<Project>
+ <PropertyGroup>
+ <Nullable>enable</Nullable>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <Deterministic>true</Deterministic>
+ </PropertyGroup>
+</Project>
diff --git a/sim/Statecraft.Cli/Program.cs b/sim/Statecraft.Cli/Program.cs
new file mode 100644
index 000000000..ac20812a9
--- /dev/null
+++ b/sim/Statecraft.Cli/Program.cs
@@ -0,0 +1 @@
+Console.WriteLine($"Statecraft sim {Statecraft.Sim.SimInfo.Version}");
diff --git a/sim/Statecraft.Cli/Statecraft.Cli.csproj b/sim/Statecraft.Cli/Statecraft.Cli.csproj
new file mode 100644
index 000000000..744af7e8a
--- /dev/null
+++ b/sim/Statecraft.Cli/Statecraft.Cli.csproj
@@ -0,0 +1,10 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>net10.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ </PropertyGroup>
+ <ItemGroup>
+ <ProjectReference Include="../Statecraft.Sim/Statecraft.Sim.csproj" />
+ </ItemGroup>
+</Project>
diff --git a/sim/Statecraft.Sim.Tests/SmokeTests.cs b/sim/Statecraft.Sim.Tests/SmokeTests.cs
new file mode 100644
index 000000000..6c157cdac
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/SmokeTests.cs
@@ -0,0 +1,7 @@
+using Statecraft.Sim;
+
+public class SmokeTests
+{
+ [Fact]
+ public void SimLibraryIsReferenced() => Assert.Equal("0.1.0", SimInfo.Version);
+}
diff --git a/sim/Statecraft.Sim.Tests/Statecraft.Sim.Tests.csproj b/sim/Statecraft.Sim.Tests/Statecraft.Sim.Tests.csproj
new file mode 100644
index 000000000..6c101829f
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/Statecraft.Sim.Tests.csproj
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFramework>net10.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <IsPackable>false</IsPackable>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
+ <PackageReference Include="xunit" Version="2.9.3" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="3.1.4" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="../Statecraft.Sim/Statecraft.Sim.csproj" />
+ </ItemGroup>
+ <ItemGroup>
+ <Using Include="Xunit" />
+ </ItemGroup>
+</Project>
diff --git a/sim/Statecraft.Sim/SimInfo.cs b/sim/Statecraft.Sim/SimInfo.cs
new file mode 100644
index 000000000..342be40a6
--- /dev/null
+++ b/sim/Statecraft.Sim/SimInfo.cs
@@ -0,0 +1,7 @@
+namespace Statecraft.Sim
+{
+ public static class SimInfo
+ {
+ public const string Version = "0.1.0";
+ }
+}
diff --git a/sim/Statecraft.Sim/Statecraft.Sim.csproj b/sim/Statecraft.Sim/Statecraft.Sim.csproj
new file mode 100644
index 000000000..f6a70c4e2
--- /dev/null
+++ b/sim/Statecraft.Sim/Statecraft.Sim.csproj
@@ -0,0 +1,10 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFramework>netstandard2.1</TargetFramework>
+ <LangVersion>9.0</LangVersion>
+ <RootNamespace>Statecraft.Sim</RootNamespace>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="YamlDotNet" Version="18.1.0" />
+ </ItemGroup>
+</Project>
diff --git a/sim/Statecraft.sln b/sim/Statecraft.sln
new file mode 100644
index 000000000..c9f49869e
--- /dev/null
+++ b/sim/Statecraft.sln
@@ -0,0 +1,62 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Statecraft.Sim", "Statecraft.Sim\Statecraft.Sim.csproj", "{9B47071E-BF7B-4753-A55C-F21D8DF62F8F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Statecraft.Sim.Tests", "Statecraft.Sim.Tests\Statecraft.Sim.Tests.csproj", "{4E8E0930-957A-4DEA-B36C-B95F7DCB580A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Statecraft.Cli", "Statecraft.Cli\Statecraft.Cli.csproj", "{4FE07CCE-DF47-4B3C-A484-D04E85C71014}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Debug|x64.Build.0 = Debug|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Debug|x86.Build.0 = Debug|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Release|x64.ActiveCfg = Release|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Release|x64.Build.0 = Release|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Release|x86.ActiveCfg = Release|Any CPU
+ {9B47071E-BF7B-4753-A55C-F21D8DF62F8F}.Release|x86.Build.0 = Release|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Debug|x64.Build.0 = Debug|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Debug|x86.Build.0 = Debug|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Release|x64.ActiveCfg = Release|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Release|x64.Build.0 = Release|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Release|x86.ActiveCfg = Release|Any CPU
+ {4E8E0930-957A-4DEA-B36C-B95F7DCB580A}.Release|x86.Build.0 = Release|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Debug|x64.Build.0 = Debug|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Debug|x86.Build.0 = Debug|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Release|x64.ActiveCfg = Release|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Release|x64.Build.0 = Release|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Release|x86.ActiveCfg = Release|Any CPU
+ {4FE07CCE-DF47-4B3C-A484-D04E85C71014}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal