Add simulation project scaffold

This commit is contained in:
2026-04-16 10:56:01 +02:00
parent 4c4089a57b
commit fc654f599d
150 changed files with 35757 additions and 12 deletions

View File

@@ -1,19 +1,81 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012 # Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SideScrollerGame.Godot", "godot/SideScrollerGame.Godot.csproj", "{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SideScrollerGame.Godot", "godot/SideScrollerGame.Godot.csproj", "{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0AB3BF05-4346-4AA6-1389-037BE0695223}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SideScrollerGame.Sim.Tests", "tests\SideScrollerGame.Sim.Tests\SideScrollerGame.Sim.Tests.csproj", "{6F63FE1D-9388-4826-9781-63D8C0AE4155}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU Debug|x64 = Debug|x64
ExportRelease|Any CPU = ExportRelease|Any CPU Debug|x86 = Debug|x86
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportDebug|x64 = ExportDebug|x64
ExportDebug|x86 = ExportDebug|x86
ExportRelease|Any CPU = ExportRelease|Any CPU
ExportRelease|x64 = ExportRelease|x64
ExportRelease|x86 = ExportRelease|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Debug|Any CPU.Build.0 = Debug|Any CPU {75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Debug|x64.ActiveCfg = Debug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Debug|x64.Build.0 = Debug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Debug|x86.ActiveCfg = Debug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Debug|x86.Build.0 = Debug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU {75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU {75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportDebug|x64.ActiveCfg = ExportDebug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportDebug|x64.Build.0 = ExportDebug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportDebug|x86.ActiveCfg = ExportDebug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportDebug|x86.Build.0 = ExportDebug|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU {75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU {75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportRelease|x64.ActiveCfg = ExportRelease|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportRelease|x64.Build.0 = ExportRelease|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportRelease|x86.ActiveCfg = ExportRelease|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.ExportRelease|x86.Build.0 = ExportRelease|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Release|Any CPU.Build.0 = Release|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Release|x64.ActiveCfg = Release|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Release|x64.Build.0 = Release|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Release|x86.ActiveCfg = Release|Any CPU
{75DE3F78-FF5C-4E58-8315-8AEF5BF95BBA}.Release|x86.Build.0 = Release|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Debug|x64.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Debug|x64.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Debug|x86.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Debug|x86.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportDebug|x64.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportDebug|x64.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportDebug|x86.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportDebug|x86.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportRelease|Any CPU.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportRelease|Any CPU.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportRelease|x64.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportRelease|x64.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportRelease|x86.ActiveCfg = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.ExportRelease|x86.Build.0 = Debug|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Release|Any CPU.Build.0 = Release|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Release|x64.ActiveCfg = Release|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Release|x64.Build.0 = Release|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Release|x86.ActiveCfg = Release|Any CPU
{6F63FE1D-9388-4826-9781-63D8C0AE4155}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{6F63FE1D-9388-4826-9781-63D8C0AE4155} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,4 +1,7 @@
<Project Sdk="Godot.NET.Sdk/4.5.1"> <Project Sdk="Godot.NET.Sdk/4.5.1">
<ItemGroup>
<ProjectReference Include="..\src\SideScrollerGame.Sim\SideScrollerGame.Sim.csproj" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net9.0</TargetFramework> <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net9.0</TargetFramework>

View File

@@ -14,8 +14,9 @@ The user-visible outcome is not merely “new projects were added.” The outcom
- [x] (2026-04-16 08:24Z) Reviewed `PLANS.md`, the original `groundwork.md`, `SideScrollerGame.sln`, and `godot/SideScrollerGame.Godot.csproj` to anchor this ExecPlan to the current repository state. - [x] (2026-04-16 08:24Z) Reviewed `PLANS.md`, the original `groundwork.md`, `SideScrollerGame.sln`, and `godot/SideScrollerGame.Godot.csproj` to anchor this ExecPlan to the current repository state.
- [x] (2026-04-16 08:32Z) Rewrote `groundwork.md` as a self-contained ExecPlan with milestones, repository orientation, exact commands, validation guidance, and living-document bookkeeping. - [x] (2026-04-16 08:32Z) Rewrote `groundwork.md` as a self-contained ExecPlan with milestones, repository orientation, exact commands, validation guidance, and living-document bookkeeping.
- [ ] Create `src/SideScrollerGame.Sim/SideScrollerGame.Sim.csproj` and `tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj`, add them to `SideScrollerGame.sln`, and wire both projects to the simulation assembly. - [x] (2026-04-16 08:49Z) Created `src/SideScrollerGame.Sim/SideScrollerGame.Sim.csproj` and `tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj`, added both to `SideScrollerGame.sln`, and wired the Godot and test projects to reference the simulation assembly.
- [ ] Copy the current root `FixPoint/*.cs` files into `src/SideScrollerGame.Sim/FixPoint/`, update namespaces, and make the simulation project the only assembly that compiles deterministic math code. - [x] (2026-04-16 08:53Z) Copied the root `FixPoint/*.cs` files into `src/SideScrollerGame.Sim/FixPoint/`, updated the namespace to `SideScrollerGame.Sim.Math`, and added a smoke test proving the simulation project owns the deterministic math layer.
- [x] (2026-04-16 09:11Z) Added bootstrap compatibility math types missing from the copied `FixPoint` subset and validated the scaffold with `dotnet build`, `dotnet test`, and `.\godot.cmd --headless --quit --path .\godot --build-solutions`.
- [ ] Implement the first runnable simulation spine: `Simulation`, `SimulationState`, `WorldSnapshot`, `TickActionBatch`, deterministic random number generation, and per-tick hashes. - [ ] Implement the first runnable simulation spine: `Simulation`, `SimulationState`, `WorldSnapshot`, `TickActionBatch`, deterministic random number generation, and per-tick hashes.
- [ ] Implement versioned save/load, replay recording, replay playback, and the optional round-trip verification modes. - [ ] Implement versioned save/load, replay recording, replay playback, and the optional round-trip verification modes.
- [ ] Implement deterministic movement, collision, damage resolution, triggers, and the fixed tick pipeline with exhaustive simulation tests. - [ ] Implement deterministic movement, collision, damage resolution, triggers, and the fixed tick pipeline with exhaustive simulation tests.
@@ -32,6 +33,12 @@ The user-visible outcome is not merely “new projects were added.” The outcom
Evidence: `rg --files` lists `FixPoint/*.cs`, `godot/SideScrollerGame.Godot.csproj`, `SideScrollerGame.sln`, `PLANS.md`, and `groundwork.md`, but no `src/` or `tests/` projects. Evidence: `rg --files` lists `FixPoint/*.cs`, `godot/SideScrollerGame.Godot.csproj`, `SideScrollerGame.sln`, `PLANS.md`, and `groundwork.md`, but no `src/` or `tests/` projects.
- Observation: the repository root contains `godot.cmd`, so all Godot commands in this plan should call that wrapper with `--path .\godot`. - Observation: the repository root contains `godot.cmd`, so all Godot commands in this plan should call that wrapper with `--path .\godot`.
Evidence: `rg --files` lists both `godot.cmd` and `godot/project.godot`. Evidence: `rg --files` lists both `godot.cmd` and `godot/project.godot`.
- Observation: copied `FixPoint` sources inherit the root files' read-only attribute, so the migration step must clear that attribute before applying namespace edits.
Evidence: `Get-Item src/SideScrollerGame.Sim/FixPoint/FixPoint16.cs` reported `Attributes : ReadOnly, Archive` immediately after the copy.
- Observation: the root `FixPoint` subset is not self-contained; it references compatibility types such as `IntVector2`, `SInt32Vector2`, `SFixPointQuaternion`, `SFixPointQuaternionTransform`, and `IntMath` that are not present in this repository snapshot.
Evidence: the first `dotnet build SideScrollerGame.sln` attempt after the copy failed with CS0246 and CS0103 errors pointing at those missing identifiers inside `FixPointVector2.cs`, `FixPointVector3.cs`, `FixPoint16.cs`, and `FixPoint16Long.cs`.
- Observation: `.\godot.cmd --headless --path .\godot --build-solutions` does not terminate on its own in this checkout, but adding `--quit` produces the expected build and exit behavior.
Evidence: the plain command timed out after five minutes, while `.\godot.cmd --headless --quit --path .\godot --build-solutions` completed successfully in roughly three seconds.
## Decision Log ## Decision Log
@@ -47,6 +54,9 @@ The user-visible outcome is not merely “new projects were added.” The outcom
- Decision: use `godot.cmd` in all concrete steps instead of the shorthand `.\godot`. - Decision: use `godot.cmd` in all concrete steps instead of the shorthand `.\godot`.
Rationale: `godot.cmd` is the wrapper that actually exists in this checkout, so the plan must describe commands that a novice can run without guessing aliases. Rationale: `godot.cmd` is the wrapper that actually exists in this checkout, so the plan must describe commands that a novice can run without guessing aliases.
Date/Author: 2026-04-16 / Codex Date/Author: 2026-04-16 / Codex
- Decision: keep the migration moving by introducing local compatibility shims for the missing fixed-point support types instead of blocking Milestone 1 on a broader math-library archaeology pass.
Rationale: the copied `FixPoint` subset already compiles and is enough for the upcoming deterministic simulation spine, while the shim types can be replaced later if fuller upstream math primitives become necessary.
Date/Author: 2026-04-16 / Codex
## Outcomes & Retrospective ## Outcomes & Retrospective
@@ -83,7 +93,7 @@ Acceptance for this milestone is that the solution builds, the test project runs
This milestone creates the smallest useful simulation loop. At the end of it, a caller can construct a `Simulation`, feed a `TickActionBatch`, advance exactly one tick, and receive a `TickResult` containing events and a deterministic hash. Run the tests and host build from `D:\Code\SideScrollerGame`: This milestone creates the smallest useful simulation loop. At the end of it, a caller can construct a `Simulation`, feed a `TickActionBatch`, advance exactly one tick, and receive a `TickResult` containing events and a deterministic hash. Run the tests and host build from `D:\Code\SideScrollerGame`:
dotnet test tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj dotnet test tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj
.\godot.cmd --headless --path .\godot --build-solutions .\godot.cmd --headless --quit --path .\godot --build-solutions
Acceptance for this milestone is behavioral. Two fresh `Simulation` instances created with the same game definition, configuration, seed, and empty action stream must produce the same tick numbers, the same state hash, and the same serialized state bytes for a sequence of no-op ticks. Acceptance for this milestone is behavioral. Two fresh `Simulation` instances created with the same game definition, configuration, seed, and empty action stream must produce the same tick numbers, the same state hash, and the same serialized state bytes for a sequence of no-op ticks.
@@ -120,7 +130,7 @@ Acceptance for this milestone is that tests can demonstrate reusable enemy behav
This milestone connects Godot authoring to simulation-safe content. At the end of it, a designer can author level markers in Godot, run a compile step, and produce deterministic runtime data under `content/compiled/` that both tests and the host can consume. Run the milestone commands from `D:\Code\SideScrollerGame`: This milestone connects Godot authoring to simulation-safe content. At the end of it, a designer can author level markers in Godot, run a compile step, and produce deterministic runtime data under `content/compiled/` that both tests and the host can consume. Run the milestone commands from `D:\Code\SideScrollerGame`:
.\godot.cmd --headless --path .\godot --build-solutions .\godot.cmd --headless --quit --path .\godot --build-solutions
dotnet test tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj --filter Content dotnet test tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj --filter Content
Acceptance for this milestone is that a level scene with spawn markers, checkpoints, trigger zones, encounter data, and music zones compiles into engine-agnostic definitions, and tests can load that compiled data without touching a live Godot scene tree. Acceptance for this milestone is that a level scene with spawn markers, checkpoints, trigger zones, encounter data, and music zones compiles into engine-agnostic definitions, and tests can load that compiled data without touching a live Godot scene tree.
@@ -130,7 +140,7 @@ Acceptance for this milestone is that a level scene with spawn markers, checkpoi
This milestone exposes the simulation to humans. At the end of it, the Godot host translates live input into `TickActionBatch` objects, runs the fixed-step simulation, interpolates between snapshots for rendering, plays overlapping sound effects and cross-faded music, and offers debug transport controls for play, pause, restart, single-step, and fast-forward. Run the proof commands from `D:\Code\SideScrollerGame`: This milestone exposes the simulation to humans. At the end of it, the Godot host translates live input into `TickActionBatch` objects, runs the fixed-step simulation, interpolates between snapshots for rendering, plays overlapping sound effects and cross-faded music, and offers debug transport controls for play, pause, restart, single-step, and fast-forward. Run the proof commands from `D:\Code\SideScrollerGame`:
.\godot.cmd --editor --path .\godot .\godot.cmd --editor --path .\godot
.\godot.cmd --headless --path .\godot --build-solutions .\godot.cmd --headless --quit --path .\godot --build-solutions
dotnet test tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj dotnet test tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj
Acceptance for this milestone is that a developer can start the Godot project, load a test level, pause the simulation, advance one step at a time, jump forward to a later tick using saved checkpoints, and observe the same state hash sequence that the automated replay tests produce. Acceptance for this milestone is that a developer can start the Godot project, load a test level, pause the simulation, advance one step at a time, jump forward to a later tick using saved checkpoints, and observe the same state hash sequence that the automated replay tests produce.
@@ -205,7 +215,7 @@ Run all commands from `D:\Code\SideScrollerGame` unless a step states otherwise.
Run: Run:
.\godot.cmd --headless --path .\godot --build-solutions .\godot.cmd --headless --quit --path .\godot --build-solutions
Expect Godot to regenerate and build C# project artifacts successfully. Expect Godot to regenerate and build C# project artifacts successfully.
@@ -221,13 +231,13 @@ Run all commands from `D:\Code\SideScrollerGame` unless a step states otherwise.
The implementation is acceptable only when a human can see deterministic behavior, not merely when the code compiles. Start with automated proof. `dotnet test tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj` must pass, and replay-oriented tests must demonstrate that the same seed and action stream yield the same per-tick debug hash sequence. The coverage command in `Concrete Steps` must enforce 100 percent line and branch coverage for gameplay logic inside `SideScrollerGame.Sim`, with only narrow exclusions for non-logic infrastructure such as generated serializers or lookup tables. The implementation is acceptable only when a human can see deterministic behavior, not merely when the code compiles. Start with automated proof. `dotnet test tests/SideScrollerGame.Sim.Tests/SideScrollerGame.Sim.Tests.csproj` must pass, and replay-oriented tests must demonstrate that the same seed and action stream yield the same per-tick debug hash sequence. The coverage command in `Concrete Steps` must enforce 100 percent line and branch coverage for gameplay logic inside `SideScrollerGame.Sim`, with only narrow exclusions for non-logic infrastructure such as generated serializers or lookup tables.
Then verify the host integration. `.\godot.cmd --headless --path .\godot --build-solutions` must succeed, proving that the Godot project can consume the simulation assembly. After that, start the editor with `.\godot.cmd --editor --path .\godot`, load a level built from compiled runtime content, and verify the following behaviors manually: play starts the simulation, pause freezes the simulation while leaving the editor responsive, advance-one-step increments the tick exactly once, fast-forward resumes from the nearest saved checkpoint and reaches the requested tick, and replaying the same recorded input reproduces the same state hash display. Then verify the host integration. `.\godot.cmd --headless --quit --path .\godot --build-solutions` must succeed, proving that the Godot project can consume the simulation assembly. After that, start the editor with `.\godot.cmd --editor --path .\godot`, load a level built from compiled runtime content, and verify the following behaviors manually: play starts the simulation, pause freezes the simulation while leaving the editor responsive, advance-one-step increments the tick exactly once, fast-forward resumes from the nearest saved checkpoint and reaches the requested tick, and replaying the same recorded input reproduces the same state hash display.
The final acceptance scenario is simple and observable. Record a short run in which the player moves, fires, triggers an encounter, collects a pickup, and reaches a checkpoint. Save the replay. Restart the host with the same compiled content and seed, play the replay, and confirm that the tick count, key gameplay events, and final state hash all match the original run. If any of those differ, the implementation is incomplete. The final acceptance scenario is simple and observable. Record a short run in which the player moves, fires, triggers an encounter, collects a pickup, and reaches a checkpoint. Save the replay. Restart the host with the same compiled content and seed, play the replay, and confirm that the tick count, key gameplay events, and final state hash all match the original run. If any of those differ, the implementation is incomplete.
## Idempotence and Recovery ## Idempotence and Recovery
Most steps in this plan are additive and safe to repeat. Re-running `dotnet build`, `dotnet test`, or `.\godot.cmd --headless --path .\godot --build-solutions` is safe and should produce the same result when the repository state has not changed. Re-running the host replay validation is also safe because replays and checkpoints are meant to be reproducible. Most steps in this plan are additive and safe to repeat. Re-running `dotnet build`, `dotnet test`, or `.\godot.cmd --headless --quit --path .\godot --build-solutions` is safe and should produce the same result when the repository state has not changed. Re-running the host replay validation is also safe because replays and checkpoints are meant to be reproducible.
Project creation commands such as `dotnet new classlib` and `dotnet new xunit` are not naturally idempotent once the destination directories already exist. If those directories have already been created, do not delete them to start over. Instead, inspect the generated files, patch them into the required shape, and continue. The same rule applies to content compilation in this Windows environment: prefer overwriting generated runtime content in place instead of deleting directories. Project creation commands such as `dotnet new classlib` and `dotnet new xunit` are not naturally idempotent once the destination directories already exist. If those directories have already been created, do not delete them to start over. Instead, inspect the generated files, patch them into the required shape, and continue. The same rule applies to content compilation in this Windows environment: prefer overwriting generated runtime content in place instead of deleting directories.

View File

@@ -0,0 +1,5 @@
namespace SideScrollerGame.Sim;
public static class SimulationAssemblyMarker
{
}

View File

@@ -0,0 +1,62 @@
namespace SideScrollerGame.Sim.Math;
public readonly struct IntVector2
{
public IntVector2(int x, int y)
{
X = x;
Y = y;
}
public int X { get; }
public int Y { get; }
}
public readonly struct SInt32Vector2
{
public SInt32Vector2(int x, int y)
{
X = x;
Y = y;
}
public int X { get; }
public int Y { get; }
}
public readonly struct SFixPointQuaternion
{
public SFixPointQuaternion(FixPoint16 x, FixPoint16 y, FixPoint16 z, FixPoint16 w)
{
m_X = x;
m_Y = y;
m_Z = z;
m_W = w;
}
public FixPoint16 m_X { get; }
public FixPoint16 m_Y { get; }
public FixPoint16 m_Z { get; }
public FixPoint16 m_W { get; }
}
public readonly struct SFixPointQuaternionTransform
{
public SFixPointQuaternionTransform(SFixPointVector3 position, SFixPointQuaternion orientation, SFixPointVector3 size)
{
m_Position = position;
m_Orientation = orientation;
m_Size = size;
}
public SFixPointVector3 m_Position { get; }
public SFixPointQuaternion m_Orientation { get; }
public SFixPointVector3 m_Size { get; }
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,386 @@
#if DEBUG
#define RANGE_CHECK
#endif
using System;
using System.Runtime.CompilerServices;
namespace SideScrollerGame.Sim.Math;
public struct FixPoint16Long : IComparable, IComparable<FixPoint16Long>, IEquatable<FixPoint16Long>
{
public FixPoint16Long(FixPoint16Long other)
{
m_Value = other.m_Value;
}
public FixPoint16Long(int value)
{
m_Value = (long)value << c_Shift;
}
public FixPoint16Long(long value)
{
#if RANGE_CHECK
if (value < c_IntegerMin || value > c_IntegerMax)
{
throw new ArithmeticException($"Long to FixPoint argument out of range: {value}");
}
#endif
m_Value = value << c_Shift;
}
public FixPoint16Long(double value)
{
#if RANGE_CHECK
if (value < c_IntegerMin || value > c_IntegerMax)
{
throw new ArithmeticException($"Double to FixPoint argument out of range: {value}");
}
#endif
if (value < 0.0)
{
m_Value = (int)((value * c_Multiplier) - 0.5);
}
else
{
m_Value = (int)((value * c_Multiplier) + 0.5);
}
}
public FixPoint16Long(float value)
{
#if RANGE_CHECK
if (value < c_IntegerMin || value > c_IntegerMax)
{
throw new ArithmeticException($"Single to FixPoint argument out of range: {value}");
}
#endif
if (value < 0.0f)
{
m_Value = (int)((value * c_MultiplierFloat) - 0.5f);
}
else
{
m_Value = (int)((value * c_MultiplierFloat) + 0.5f);
}
}
public long ToLongFloor()
{
return m_Value >> c_Shift;
}
public long ToLongCeil()
{
return (m_Value + c_FractionMask) >> c_Shift;
}
public long ToLongRound()
{
if (m_Value < 0)
{
return -((-m_Value + c_Half) >> c_Shift);
}
return (m_Value + c_Half) >> c_Shift;
}
public long ToLong()
{
if (m_Value < 0)
{
return -(-m_Value >> c_Shift);
}
return m_Value >> c_Shift;
}
public double ToDouble()
{
return c_Divisor * m_Value;
}
public float ToFloat()
{
return c_DivisorFloat * m_Value;
}
public override string ToString()
{
return $"{ToDouble()}[0x{m_Value:x16}]";
}
public override int GetHashCode()
{
return m_Value.GetHashCode();
}
public int CompareTo(object? obj)
{
if (obj is not FixPoint16Long other)
return -1;
return m_Value.CompareTo(other.m_Value);
}
public int CompareTo(FixPoint16Long other)
{
return m_Value.CompareTo(other.m_Value);
}
public override bool Equals(object? obj)
{
if (obj == null)
{
return false;
}
return ((FixPoint16Long)obj).m_Value == m_Value;
}
public bool Equals(FixPoint16Long other)
{
return other.m_Value == m_Value;
}
public bool IsZero()
{
return m_Value == 0L;
}
public static bool operator ==(FixPoint16Long a, FixPoint16Long b)
{
return a.m_Value == b.m_Value;
}
public static bool operator !=(FixPoint16Long a, FixPoint16Long b)
{
return a.m_Value != b.m_Value;
}
public static bool operator <(FixPoint16Long a, FixPoint16Long b)
{
return a.m_Value < b.m_Value;
}
public static bool operator >(FixPoint16Long a, FixPoint16Long b)
{
return a.m_Value > b.m_Value;
}
public static bool operator <=(FixPoint16Long a, FixPoint16Long b)
{
return a.m_Value <= b.m_Value;
}
public static bool operator >=(FixPoint16Long a, FixPoint16Long b)
{
return a.m_Value >= b.m_Value;
}
public static FixPoint16Long operator <<(FixPoint16Long a, int shift)
{
return new() { m_Value = a.m_Value << shift };
}
public static FixPoint16Long operator >> (FixPoint16Long a, int shift)
{
return new() { m_Value = a.m_Value >> shift };
}
public static FixPoint16Long operator +(FixPoint16Long a, FixPoint16Long b)
{
return new() { m_Value = a.m_Value + b.m_Value };
}
public static FixPoint16Long operator -(FixPoint16Long a, FixPoint16Long b)
{
return new() { m_Value = a.m_Value - b.m_Value };
}
public static FixPoint16Long operator *(FixPoint16Long a, FixPoint16Long b)
{
Int128 bigA = a.m_Value;
Int128 bigB = b.m_Value;
var result = ((bigA * bigB) + c_Half) >> c_Shift;
#if RANGE_CHECK
if (result < long.MinValue || result > long.MaxValue)
{
throw new ArithmeticException($"Multiplication result out of range: {result}");
}
#endif
return new() { m_Value = (long)result };
}
public static FixPoint16Long operator /(FixPoint16Long a, FixPoint16Long b)
{
#if RANGE_CHECK
if (b.m_Value == 0)
{
throw new ArithmeticException("Divison by zero");
}
#endif
Int128 result;
if (((ulong)a.m_Value & 0x8000000000000000UL) == ((ulong)b.m_Value & 0x8000000000000000UL))
{
result = (((Int128)a.m_Value << c_Shift) + (b.m_Value / 2)) / b.m_Value;
}
else
{
result = (((Int128)a.m_Value << c_Shift) - (b.m_Value / 2)) / b.m_Value;
}
#if RANGE_CHECK
if (result < long.MinValue || result > long.MaxValue)
{
throw new ArithmeticException($"Division result out of range: {result}");
}
#endif
return new() { m_Value = (long)result };
}
public static FixPoint16Long operator -(FixPoint16Long a)
{
return new() { m_Value = -a.m_Value };
}
public static FixPoint16Long operator *(FixPoint16Long a, int value)
{
return new() { m_Value = a.m_Value * value };
}
public static FixPoint16Long operator /(FixPoint16Long a, int value)
{
#if RANGE_CHECK
if (value == 0)
{
throw new ArithmeticException("Divison by zero");
}
#endif
if (((a.m_Value >> 32) & 0x80000000) == (value & 0x80000000))
{
return new() { m_Value = (long)(((Int128)a.m_Value + (value / 2)) / value) };
}
return new() { m_Value = (long)(((Int128)a.m_Value - (value / 2)) / value) };
}
public static implicit operator FixPoint16Long(int value)
{
return new(value);
}
public static implicit operator FixPoint16Long(long value)
{
return new(value);
}
public static implicit operator FixPoint16Long(FixPoint16 value)
{
return new() { m_Value = value.m_Value };
}
public static explicit operator FixPoint16Long(double value)
{
return new(value);
}
public static explicit operator FixPoint16Long(float value)
{
return new(value);
}
public static explicit operator int(FixPoint16Long value)
{
return (int)value.ToLong();
}
public static explicit operator long(FixPoint16Long value)
{
return value.ToLong();
}
public static explicit operator double(FixPoint16Long value)
{
return value.ToDouble();
}
public static explicit operator float(FixPoint16Long value)
{
return value.ToFloat();
}
public static FixPoint16Long Floor(FixPoint16Long value)
{
return value.ToLongFloor();
}
public static FixPoint16Long Ceil(FixPoint16Long value)
{
return value.ToLongCeil();
}
public static FixPoint16Long Round(FixPoint16Long value)
{
return value.ToLongRound();
}
public static int Sign(FixPoint16Long value)
{
return System.Math.Sign(value.m_Value);
}
public static FixPoint16Long Abs(FixPoint16Long value)
{
return new() { m_Value = System.Math.Abs(value.m_Value) };
}
public static FixPoint16Long Min(FixPoint16Long value1, FixPoint16Long value2)
{
return new() { m_Value = System.Math.Min(value1.m_Value, value2.m_Value) };
}
public static FixPoint16Long Max(FixPoint16Long value1, FixPoint16Long value2)
{
return new() { m_Value = System.Math.Max(value1.m_Value, value2.m_Value) };
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static FixPoint16Long Length(FixPoint16Long a, FixPoint16Long b)
{
var aSquared = a.m_Value * a.m_Value;
var bSquared = b.m_Value * b.m_Value;
var value = aSquared + bSquared;
#if RANGE_CHECK
if (value < 0)
{
throw new ArithmeticException($"Length squared out of range: {value}");
}
#endif
return new() { m_Value = IntMath.Sqrt(value) };
}
private const int c_Shift = 16;
private const long c_IntegerMin = -140737488355327L;
private const long c_IntegerMax = 140737488355327L;
private const long c_Half = 32786L;
private const long c_FractionMask = 0x000000000000ffffL;
private const double c_Multiplier = 65536.0;
private const double c_Divisor = 1.0 / 65536.0;
private const float c_MultiplierFloat = 65536.0f;
private const float c_DivisorFloat = (float)c_Divisor;
public long m_Value;
public static readonly FixPoint16Long Zero = new() { m_Value = 0 };
public static readonly FixPoint16Long MinValue = new() { m_Value = long.MinValue };
public static readonly FixPoint16Long MaxValue = new() { m_Value = long.MaxValue };
public static readonly FixPoint16Long Epsilon = new() { m_Value = 1 };
public static readonly FixPoint16Long MinusEpsilon = new() { m_Value = -1 };
public static readonly FixPoint16Long One = new(1);
public static readonly FixPoint16Long MinusOne = new(-1);
public static readonly FixPoint16Long Half = new() { m_Value = One.m_Value / 2 };
public static readonly FixPoint16Long MinusHalf = -Half;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,69 @@
namespace SideScrollerGame.Sim.Math;
public static class FixPointUtil
{
public static long DistancePointToSegmentSquared(FixPointVector2 point, FixPointVector2 segmentStart, FixPointVector2 segmentEnd)
{
var segment = segmentEnd - segmentStart;
var toStart = point - segmentStart;
var segmentLengthSquared = FixPointVector2.DotLong(segment, segment);
if (segmentLengthSquared == 0L)
return FixPointVector2.DotLong(toStart, toStart);
var projection = FixPointVector2.DotLong(toStart, segment);
if (projection <= 0)
return FixPointVector2.DotLong(toStart, toStart);
FixPointVector2 toPointOnSegment;
if (projection >= segmentLengthSquared)
toPointOnSegment = point - segmentEnd;
else
toPointOnSegment = toStart - segment * FixPoint16.FromRational(projection, segmentLengthSquared);
return FixPointVector2.DotLong(toPointOnSegment, toPointOnSegment);
}
public static FixPoint16 DistancePointToSegment(FixPointVector2 point, FixPointVector2 segmentStart, FixPointVector2 segmentEnd)
{
return FixPoint16.SqrtLong(DistancePointToSegmentSquared(point, segmentStart, segmentEnd));
}
public static bool LineLineIntersection(FixPointVector2 line1Start, FixPointVector2 line1End, FixPointVector2 line2Start, FixPointVector2 line2End, out FixPointVector2 intersectionPoint)
{
intersectionPoint = default;
var s1 = line1End - line1Start;
var s2 = line2End - line2Start;
var det = (FixPoint16Long)(-s2.m_X) * s1.m_Y + (FixPoint16Long)(s1.m_X) * s2.m_Y;
if (FixPoint16Long.Abs(det) < s_IntersectionEpsilon)
return false;
var t = ((FixPoint16Long)s2.m_X * (line1Start.m_Y - line2Start.m_Y) - (FixPoint16Long)s2.m_Y * (line1Start .m_X - line2Start.m_X)) / det;
var px = line1Start.m_X + (t * s1.m_X);
var py = line1Start.m_Y + (t * s1.m_Y);
if (px.m_Value > s_LineIntersectionMax || px.m_Value < s_LineIntersectionMin || py.m_Value > s_LineIntersectionMax || py.m_Value < s_LineIntersectionMin)
return false;
intersectionPoint = new FixPointVector2(FixPoint16.FromValue(px.m_Value), FixPoint16.FromValue(py.m_Value));
return true;
}
public static FixPoint16 MultiplyClamped(FixPoint16 a, FixPoint16 b)
{
var iResult = (((long)a.m_Value * b.m_Value) + FixPoint16.c_Half) >> FixPoint16.c_Shift;
if (iResult < FixPoint16.c_LongMin)
iResult = FixPoint16.c_LongMin;
else if (iResult > FixPoint16.c_LongMax)
iResult = FixPoint16.c_LongMax;
return new() { m_Value = (int)iResult };
}
private static readonly FixPoint16 s_IntersectionEpsilon = FixPoint16.Epsilon * 30;
private static readonly long s_LineIntersectionMax = FixPoint16.c_LongMax / 4;
private static readonly long s_LineIntersectionMin = FixPoint16.c_LongMin / 4;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,993 @@
using System;
using System.Diagnostics.Contracts;
using System.Numerics;
using System.Runtime.CompilerServices;
namespace SideScrollerGame.Sim.Math;
public struct SFixPointVector3 : IEquatable<SFixPointVector3>
{
/// <summary>
/// Initializes a new instance of FixPointVector3
/// </summary>
/// <param name="x">Initial value for the x-component of the vector.</param>
/// <param name="y">Initial value for the y-component of the vector.</param>
/// <param name="z">Initial value for the z-component of the vector.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public SFixPointVector3(int x, int y, int z)
{
m_X = x;
m_Y = y;
m_Z = z;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public SFixPointVector3(FixPoint16 x, FixPoint16 y, FixPoint16 z)
{
m_X = x;
m_Y = y;
m_Z = z;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public SFixPointVector3(FixPoint16 x)
{
m_X = x;
m_Y = x;
m_Z = x;
}
public SFixPointVector3(float x, float y, float z)
{
m_X = new(x);
m_Y = new(y);
m_Z = new(z);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public SFixPointVector3(Vector3 coord)
{
m_X = new(coord.X);
m_Y = new(coord.Y);
m_Z = new(coord.Z);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator SFixPointVector3(Vector3 coord)
{
return new(new(coord.X), new(coord.Y), new FixPoint16(coord.Z));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator Vector3(SFixPointVector3 coord)
{
return new(coord.m_X.ToFloat(), coord.m_Y.ToFloat(), coord.m_Z.ToFloat());
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public Vector3 ToVector3()
{
return new(m_X.ToFloat(), m_Y.ToFloat(), m_Z.ToFloat());
}
#region -- base overrides ---------------------------------------------
[Pure]
public override string ToString()
{
return $"({m_X.ToString()}, {m_Y.ToString()}, {m_Z.ToString()})";
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public bool Equals(SFixPointVector3 other)
{
return m_X == other.m_X && m_Y == other.m_Y && m_Z == other.m_Z;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public override bool Equals(object? obj)
{
if (obj is SFixPointVector3 fixPointVector3)
return Equals(fixPointVector3);
return false;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public override int GetHashCode()
{
return m_X.GetHashCode() + m_Y.GetHashCode() + m_Z.GetHashCode();
}
#endregion
#region -- static properties ------------------------------------------
public static readonly SFixPointVector3 s_Zero = new(0, 0, 0);
public static readonly SFixPointVector3 s_One = new(1, 1, 1);
public static readonly SFixPointVector3 s_UnitX = new(1, 0, 0);
public static readonly SFixPointVector3 s_UnitY = new(0, 1, 0);
public static readonly SFixPointVector3 s_UnitZ = new(0, 0, 1);
public static readonly SFixPointVector3 s_MaxValue = new(FixPoint16.MaxValue, FixPoint16.MaxValue, FixPoint16.MaxValue);
public static readonly SFixPointVector3 s_MinValue = new(FixPoint16.MinValue, FixPoint16.MinValue, FixPoint16.MinValue);
#endregion
#region -- public properties -----------------------------------------
public FixPoint16 this[int i]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
get
{
switch (i)
{
case 0: return m_X;
case 1: return m_Y;
case 2: return m_Z;
default: throw new ArgumentOutOfRangeException(nameof(i));
}
}
set
{
switch (i)
{
case 0:
m_X = value;
break;
case 1:
m_Y = value;
break;
case 2:
m_Z = value;
break;
default: throw new ArgumentOutOfRangeException(nameof(i));
}
}
}
/// <summary>
/// Returns a new normalized FixPointVector3 from the current vector.
/// </summary>
public SFixPointVector3 Normalized
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
get
{
var length = Length();
if (!length.IsZero())
{
SFixPointVector3 result = new(m_X / length, m_Y / length, m_Z / length);
return result;
}
throw new InvalidOperationException("Error: can not normalize vector, the vector length is zero.");
}
}
public FixPointVector2 XY
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
get => new(m_X, m_Y);
}
public FixPointVector2 XZ
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
get => new(m_X, m_Z);
}
#endregion
#region -- public methods ---------------------------------------------
/// <summary>
/// Calculates the length of the current vector.
/// </summary>
/// <returns>The Length of the current vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public FixPoint16 Length()
{
return FixPoint16.Length(m_X, m_Y, m_Z);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public int CompareLength(FixPoint16 length)
{
unchecked
{
return ((m_X.m_Value * (long)m_X.m_Value) + (m_Y.m_Value * (long)m_Y.m_Value) + (m_Z.m_Value * (long)m_Z.m_Value)).CompareTo(length.m_Value * (long)length.m_Value);
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public long LengthSquaredLong()
{
unchecked
{
return (m_X.m_Value * (long)m_X.m_Value) + (m_Y.m_Value * (long)m_Y.m_Value) + (m_Z.m_Value * (long)m_Z.m_Value);
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public int CompareLength(SFixPointVector3 other)
{
unchecked
{
return ((m_X.m_Value * (long)m_X.m_Value) + (m_Y.m_Value * (long)m_Y.m_Value) + (m_Z.m_Value * (long)m_Z.m_Value)).CompareTo(
(other.m_X.m_Value * (long)other.m_X.m_Value) + (other.m_Y.m_Value * (long)other.m_Y.m_Value) + (other.m_Z.m_Value * (long)other.m_Z.m_Value));
}
}
/// <summary>
/// Normalizes the current vector
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Normalize()
{
unchecked
{
var length = Length();
if (!length.IsZero())
{
m_X = m_X / length;
m_Y = m_Y / length;
m_Z = m_Z / length;
}
#if DEBUG
else
{
throw new("Error: can not normalize vector, the vector length is zero.");
}
#endif
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public bool IsZero()
{
return m_X.IsZero() && m_Y.IsZero() && m_Z.IsZero();
}
/// <summary>
/// Adds a given scalar value to each component of the current FixPointVector3.
/// </summary>
/// <param name="value">The scalar value</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Add(FixPoint16 value)
{
unchecked
{
m_X = m_X + value;
m_Y = m_Y + value;
m_Z = m_Z + value;
}
}
/// <summary>
/// Adds a given FixPointVector3 to the current FixPointVector3.
/// </summary>
/// <param name="other">The vector to be added.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Add(SFixPointVector3 other)
{
unchecked
{
m_X = m_X + other.m_X;
m_Y = m_Y + other.m_Y;
m_Z = m_Z + other.m_Z;
}
}
/// <summary>
/// Subtracts a scalar value from each component of the current FixPointVector3.
/// </summary>
/// <param name="value">The scalar value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Subtract(FixPoint16 value)
{
unchecked
{
m_X = m_X - value;
m_Y = m_Y - value;
m_Z = m_Z - value;
}
}
/// <summary>
/// Subtracts a given FixPointVector3 from the current FixPointVector3.
/// </summary>
/// <param name="other">The vector to be subtracted.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Subtract(SFixPointVector3 other)
{
unchecked
{
m_X = m_X - other.m_X;
m_Y = m_Y - other.m_Y;
m_Z = m_Z - other.m_Z;
}
}
/// <summary>
/// Multiplies each component of the current FixPointVector3 by a given scalar value.
/// </summary>
/// <param name="scalar">The scalar value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Multiply(FixPoint16 scalar)
{
unchecked
{
m_X = m_X * scalar;
m_Y = m_Y * scalar;
m_Z = m_Z * scalar;
}
}
/// <summary>
/// Multiplies the current FixPointVector3 by another FixPointVector3.
/// </summary>
/// <param name="other">The source vector.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Multiply(SFixPointVector3 other)
{
unchecked
{
m_X = m_X * other.m_X;
m_Y = m_Y * other.m_Y;
m_Z = m_Z * other.m_Z;
}
}
/// <summary>
/// Divides each component of the current FixPointVector3 by a given scalar value.
/// </summary>
/// <param name="divider">The scalar divider.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Divide(FixPoint16 divider)
{
#if DEBUG
if (divider.IsZero())
throw new("Error: divider is zero (FixPointVector3.Divide).");
#endif
unchecked
{
m_X = m_X / divider;
m_Y = m_Y / divider;
m_Z = m_Z / divider;
}
}
/// <summary>
/// Divides the current FixPointVector3 by another FixPointVector3.
/// </summary>
/// <param name="other">The vector divider.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Divide(SFixPointVector3 other)
{
unchecked
{
if (!other.m_X.IsZero() && !other.m_Y.IsZero() && !other.m_Z.IsZero())
{
m_X = m_X / other.m_X;
m_Y = m_Y / other.m_Y;
m_Z = m_Z / other.m_Z;
}
#if DEBUG
else
{
throw new("Error: divider vector contains zero (FixPointVector3.Divide).");
}
#endif
}
}
/// <summary>
/// Transforms a FixPointVector3.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public static SFixPointVector3 Transform(SFixPointVector3 v, SFixPointQuaternionTransform t)
{
return Transform(v * t.m_Size, t.m_Orientation) + t.m_Position;
}
/// <summary>
/// Transforms a vector by the given Quaternion rotation value.
/// </summary>
/// <param name="value">The source vector to be rotated.</param>
/// <param name="rotation">The rotation to apply.</param>
/// <returns>The transformed vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Transform(SFixPointVector3 value, SFixPointQuaternion rotation)
{
var x2 = rotation.m_X + rotation.m_X;
var y2 = rotation.m_Y + rotation.m_Y;
var z2 = rotation.m_Z + rotation.m_Z;
var wx2 = rotation.m_W * x2;
var wy2 = rotation.m_W * y2;
var wz2 = rotation.m_W * z2;
var xx2 = rotation.m_X * x2;
var xy2 = rotation.m_X * y2;
var xz2 = rotation.m_X * z2;
var yy2 = rotation.m_Y * y2;
var yz2 = rotation.m_Y * z2;
var zz2 = rotation.m_Z * z2;
return new((value.m_X * (1 - yy2 - zz2)) + (value.m_Y * (xy2 - wz2)) + (value.m_Z * (xz2 + wy2)), (value.m_X * (xy2 + wz2)) + (value.m_Y * (1 - xx2 - zz2)) + (value.m_Z * (yz2 - wx2)),
(value.m_X * (xz2 - wy2)) + (value.m_Y * (yz2 + wx2)) + (value.m_Z * (1 - xx2 - yy2)));
}
#endregion
#region -- public static methods --------------------------------------
/// <summary>
/// Calculates the length of the given vector.
/// </summary>
/// <returns>The Length of the given vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static FixPoint16 Length(SFixPointVector3 value)
{
return value.Length();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int CompareLength(SFixPointVector3 value, FixPoint16 fLength)
{
unchecked
{
return ((value.m_X.m_Value * (long)value.m_X.m_Value) + (value.m_Y.m_Value * (long)value.m_Y.m_Value) + (value.m_Z.m_Value * (long)value.m_Z.m_Value)).CompareTo(
fLength.m_Value * (long)fLength.m_Value);
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int CompareLength(SFixPointVector3 value1, SFixPointVector3 value2)
{
unchecked
{
return ((value1.m_X.m_Value * (long)value1.m_X.m_Value) + (value1.m_Y.m_Value * (long)value1.m_Y.m_Value) + (value1.m_Z.m_Value * (long)value1.m_Z.m_Value)).CompareTo(
(value2.m_X.m_Value * (long)value2.m_X.m_Value) + (value2.m_Y.m_Value * (long)value2.m_Y.m_Value) + (value2.m_Z.m_Value * (long)value2.m_Z.m_Value));
}
}
/// <summary>
/// Computes the cross product of two vectors.
/// </summary>
/// <param name="vector1">The first vector.</param>
/// <param name="vector2">The second vector.</param>
/// <returns>The cross product.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Cross(SFixPointVector3 vector1, SFixPointVector3 vector2)
{
return new((vector1.m_Y * vector2.m_Z) - (vector1.m_Z * vector2.m_Y), (vector1.m_Z * vector2.m_X) - (vector1.m_X * vector2.m_Z),
(vector1.m_X * vector2.m_Y) - (vector1.m_Y * vector2.m_X));
}
/// <summary>
/// Calculates the distance between two vectors. (manhatten/taxi-cab metrix)
/// </summary>
/// <param name="left">The source vector</param>
/// <param name="right">The source vector</param>
/// <returns>Distance between the two vectors.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static FixPoint16 DistanceManhattan(SFixPointVector3 left, SFixPointVector3 right)
{
return FixPoint16.Abs(left.m_X - right.m_X) + FixPoint16.Abs(left.m_Y - right.m_Y) + FixPoint16.Abs(left.m_Z - right.m_Z);
}
/// <summary>
/// Calculates the distance between two vectors.
/// </summary>
/// <param name="left">The source vector</param>
/// <param name="right">The source vector</param>
/// <returns>Distance between the two vectors.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static FixPoint16 Distance(SFixPointVector3 left, SFixPointVector3 right)
{
var dx = left.m_X - right.m_X;
var dy = left.m_Y - right.m_Y;
var dz = left.m_Z - right.m_Z;
return FixPoint16.Length(dx, dy, dz);
}
/// <summary>
/// Calculates the dot product of two vectors.
/// </summary>
/// <param name="left">The source vector.</param>
/// <param name="right">The source vector.</param>
/// <returns>The dot product of the two vectors.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static FixPoint16 Dot(SFixPointVector3 left, SFixPointVector3 right)
{
return (left.m_X * right.m_X) + (left.m_Y * right.m_Y) + (left.m_Z * right.m_Z);
}
/// <summary>
/// Calculates the dot product of two vectors.
/// </summary>
/// <param name="left">The source vector.</param>
/// <param name="right">The source vector.</param>
/// <returns>The dot product of the two vectors.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static FixPoint16Long DotLong(SFixPointVector3 left, SFixPointVector3 right)
{
return new() { m_Value = (left.m_X.m_Value * (long)right.m_X.m_Value) + (left.m_Y.m_Value * (long)right.m_Y.m_Value) + (left.m_Z.m_Value * (long)right.m_Z.m_Value) };
}
/// <summary>
/// Calculates the sign of the dot product of two vectors.
/// </summary>
/// <param name="left">The source vector.</param>
/// <param name="right">The source vector.</param>
/// <returns>The sign of the dot product of the two vectors.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int DotSign(SFixPointVector3 left, SFixPointVector3 right)
{
unchecked
{
return ((left.m_X.m_Value * (long)right.m_X.m_Value) + (left.m_Y.m_Value * (long)right.m_Y.m_Value) + (left.m_Z.m_Value * (long)right.m_Z.m_Value)).CompareTo(0);
}
}
/// <summary>
/// Creates a unit vector from the specified vector.
/// </summary>
/// <param name="value">The source vector.</param>
/// <returns>The created unit vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Normalize(SFixPointVector3 value)
{
return value.Normalized;
}
/// <summary>
/// Returns a vector that contains the lowest value from each matching pair of components.
/// </summary>
/// <param name="value1">The source vector.</param>
/// <param name="value2">The source vector.</param>
/// <returns>The minimized vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Min(SFixPointVector3 value1, SFixPointVector3 value2)
{
SFixPointVector3 result;
result.m_X = FixPoint16.Min(value1.m_X, value2.m_X);
result.m_Y = FixPoint16.Min(value1.m_Y, value2.m_Y);
result.m_Z = FixPoint16.Min(value1.m_Z, value2.m_Z);
return result;
}
/// <summary>
/// Returns a vector that contains the highest value from each matching pair of components.
/// </summary>
/// <param name="value1">The source vector.</param>
/// <param name="value2">The source vector.</param>
/// <returns>The maximized vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Max(SFixPointVector3 value1, SFixPointVector3 value2)
{
SFixPointVector3 result;
result.m_X = FixPoint16.Max(value1.m_X, value2.m_X);
result.m_Y = FixPoint16.Max(value1.m_Y, value2.m_Y);
result.m_Z = FixPoint16.Max(value1.m_Z, value2.m_Z);
return result;
}
/// <summary>
/// Returns a vector pointing in the opposite direction.
/// </summary>
/// <param name="value">The source vector.</param>
/// <returns>A new vector pointing in the opposite direction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Negate(SFixPointVector3 value)
{
unchecked
{
SFixPointVector3 result;
result.m_X = -value.m_X;
result.m_Y = -value.m_Y;
result.m_Z = -value.m_Z;
return result;
}
}
/// <summary>
/// Adds two vectors
/// </summary>
/// <param name="value1">The source vector.</param>
/// <param name="value2">The source vector.</param>
/// <returns>A new vector representing the sum of the source vectors.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Add(SFixPointVector3 value1, SFixPointVector3 value2)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value1.m_X + value2.m_X;
result.m_Y = value1.m_Y + value2.m_Y;
result.m_Z = value1.m_Z + value2.m_Z;
return result;
}
}
/// <summary>
/// Adds a given scalar value to each component of a given vector.
/// </summary>
/// <param name="value1">The source vector.</param>
/// <param name="value2">The scalar value to be added to the vector.</param>
/// <returns>A new FixPointVector3 representing the sum of the given vector and scalar.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Add(SFixPointVector3 value1, FixPoint16 value2)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value1.m_X + value2;
result.m_Y = value1.m_Y + value2;
result.m_Z = value1.m_Z + value2;
return result;
}
}
/// <summary>
/// Subtracts a vector from another vector.
/// </summary>
/// <param name="value1">The vector to be subtracted from.</param>
/// <param name="value2">The vector to be subtracted.</param>
/// <returns>A new vector representing the result of the subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Subtract(SFixPointVector3 value1, SFixPointVector3 value2)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value1.m_X - value2.m_X;
result.m_Y = value1.m_Y - value2.m_Y;
result.m_Z = value1.m_Z - value2.m_Z;
return result;
}
}
/// <summary>
/// Subtracts a given scalar value from each component of a given vector.
/// </summary>
/// <param name="value1">The vector to be subtracted from.</param>
/// <param name="value2">The scalar value to subtracted.</param>
/// <returns>A new FixPointVector3 representing the result of the subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Subtract(SFixPointVector3 value1, FixPoint16 value2)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value1.m_X - value2;
result.m_Y = value1.m_Y - value2;
result.m_Z = value1.m_Z - value2;
return result;
}
}
/// <summary>
/// Multiplies the components of two vectors by each other.
/// </summary>
/// <param name="value1">The source vector.</param>
/// <param name="value2">The source vector.</param>
/// <returns>A new vector representing the result of the mulitiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Multiply(SFixPointVector3 value1, SFixPointVector3 value2)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value1.m_X * value2.m_X;
result.m_Y = value1.m_Y * value2.m_Y;
result.m_Z = value1.m_Z * value2.m_Z;
return result;
}
}
/// <summary>
/// Multiplies a vector by a scalar value.
/// </summary>
/// <param name="value">The source vector.</param>
/// <param name="scalar">The scalar value.</param>
/// <returns>A new vector representing the result of the mulitiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Multiply(SFixPointVector3 value, FixPoint16 scalar)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value.m_X * scalar;
result.m_Y = value.m_Y * scalar;
result.m_Z = value.m_Z * scalar;
return result;
}
}
/// <summary>
/// Divides the components of a vector by the components of another vector.
/// </summary>
/// <param name="value1">The source vector.</param>
/// <param name="value2">The divisor vector.</param>
/// <returns>A new vector representing the result of the division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Divide(SFixPointVector3 value1, SFixPointVector3 value2)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value1.m_X / value2.m_X;
result.m_Y = value1.m_Y / value2.m_Y;
result.m_Z = value1.m_Z / value2.m_Z;
return result;
}
}
/// <summary>
/// Projects a vector onto another vector.
/// </summary>
/// <param name="projected">The projected vector.</param>
/// <param name="projectionTarget">The vector the projected vector is being projected on.</param>
/// <returns>A new vector representing the result of the division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Project(SFixPointVector3 projected, SFixPointVector3 projectionTarget)
{
unchecked
{
SFixPointVector3 result;
var fpDot = Dot(projected, projectionTarget);
var fpProjectionTargetLength = projectionTarget.Length();
var fpScalar = fpDot / (fpProjectionTargetLength * fpProjectionTargetLength);
result = projectionTarget * fpScalar;
return result;
}
}
/// <summary>
/// Divides a vector by a scalar value.
/// </summary>
/// <param name="value">The source vector.</param>
/// <param name="divider">The divider</param>
/// <returns>A new vector representing the result of the division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Divide(SFixPointVector3 value, FixPoint16 divider)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value.m_X / divider;
result.m_Y = value.m_Y / divider;
result.m_Z = value.m_Z / divider;
return result;
}
}
/// <summary>
/// Creates a new FixPointVector3 with each component being the result of dividing a scalar value by the corresponding
/// component of a vector.
/// </summary>
/// <param name="value">The scalar value to be divided.</param>
/// <param name="divider">The divider vector</param>
/// <returns>
/// A new vector with each component being the result of dividing the scalar value by the corresponding component
/// of the vector.
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Divide(FixPoint16 value, SFixPointVector3 divider)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value / divider.m_X;
result.m_Y = value / divider.m_Y;
result.m_Z = value / divider.m_Z;
return result;
}
}
/// <summary>
/// Performs a linear interpolation between two vectors.
/// </summary>
/// <param name="value1">The source vector.</param>
/// <param name="value2">The source vector.</param>
/// <param name="amount">
/// The value between 0 and 1 indicating the weight of _value2. '0.0' will cause _value1 to be
/// returned; '1.0' will cause _value2 to be returned.
/// </param>
/// <returns>The linear interpolation of the two vectors.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 Lerp(SFixPointVector3 value1, SFixPointVector3 value2, FixPoint16 amount)
{
unchecked
{
SFixPointVector3 result;
result.m_X = value1.m_X + (amount * (value2.m_X - value1.m_X));
result.m_Y = value1.m_Y + (amount * (value2.m_Y - value1.m_Y));
result.m_Z = value1.m_Z + (amount * (value2.m_Z - value1.m_Z));
return result;
}
}
/// <summary>
/// Interpolates between two vectors using a cubic equation.
/// </summary>
/// <param name="value1">The source value.</param>
/// <param name="value2">The source value.</param>
/// <param name="amount">The weighting value.</param>
/// <returns>The interpolated value.</returns>
public static SFixPointVector3 SmoothStep(SFixPointVector3 value1, SFixPointVector3 value2, FixPoint16 amount)
{
var smootstep = FixPoint16.Min(0, FixPoint16.Max(1, amount));
smootstep = smootstep * smootstep * (3 - (2 * smootstep));
return Lerp(value1, value2, smootstep);
}
/// <summary>
/// Returns a FixPointVector3 containing the 2D Cartesian coordinates of a point specified in barycentric (areal)
/// coordinates relative to a 2D triangle.
/// </summary>
/// <param name="value1">A FixPointVector3 containing the 2D Cartesian coordinates of vertex 1 of the triangle.</param>
/// <param name="value2">A FixPointVector3 containing the 2D Cartesian coordinates of vertex 2 of the triangle.</param>
/// <param name="value3">A FixPointVector3 containing the 2D Cartesian coordinates of vertex 3 of the triangle.</param>
/// <param name="amount1">
/// Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in
/// _value2).
/// </param>
/// <param name="amount2">
/// Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in
/// _value3).
/// </param>
/// <returns>A new FixPointVector3 containing the 2D Cartesian coordinates of the specified point.</returns>
public static SFixPointVector3 Barycentric(SFixPointVector3 value1, SFixPointVector3 value2, SFixPointVector3 value3, FixPoint16 amount1, FixPoint16 amount2)
{
SFixPointVector3 result;
result.m_X = value1.m_X + (amount1 * (value2.m_X - value1.m_X)) + (amount2 * (value3.m_X - value1.m_X));
result.m_Y = value1.m_Y + (amount1 * (value2.m_Y - value1.m_Y)) + (amount2 * (value3.m_Y - value1.m_Y));
result.m_Z = value1.m_Z + (amount1 * (value2.m_Z - value1.m_Z)) + (amount2 * (value3.m_Z - value1.m_Z));
return result;
}
public static SFixPointVector3 Fract(SFixPointVector3 p)
{
return new(FixPoint16.Fract(p.m_X), FixPoint16.Fract(p.m_Y), FixPoint16.Fract(p.m_Z));
}
#endregion
#region -- operators --------------------------------------------------
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(SFixPointVector3 left, SFixPointVector3 right)
{
return left.Equals(right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(SFixPointVector3 left, SFixPointVector3 right)
{
return !left.Equals(right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator -(SFixPointVector3 value)
{
return Negate(value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator +(SFixPointVector3 left, SFixPointVector3 right)
{
unchecked
{
SFixPointVector3 result;
result.m_X = left.m_X + right.m_X;
result.m_Y = left.m_Y + right.m_Y;
result.m_Z = left.m_Z + right.m_Z;
return result;
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator +(SFixPointVector3 left, FixPoint16 right)
{
return Add(left, right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator -(SFixPointVector3 left, SFixPointVector3 right)
{
unchecked
{
SFixPointVector3 result;
result.m_X = left.m_X - right.m_X;
result.m_Y = left.m_Y - right.m_Y;
result.m_Z = left.m_Z - right.m_Z;
return result;
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator -(SFixPointVector3 left, FixPoint16 right)
{
return Subtract(left, right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator *(SFixPointVector3 left, SFixPointVector3 right)
{
return Multiply(left, right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator *(SFixPointVector3 left, FixPoint16 right)
{
return new() {
m_X = left.m_X * right,
m_Y = left.m_Y * right,
m_Z = left.m_Z * right
};
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator *(FixPoint16 left, SFixPointVector3 right)
{
return Multiply(right, left);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator /(SFixPointVector3 left, SFixPointVector3 right)
{
return Divide(left, right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator /(SFixPointVector3 left, FixPoint16 right)
{
return new() {
m_X = left.m_X / right,
m_Y = left.m_Y / right,
m_Z = left.m_Z / right
};
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static SFixPointVector3 operator /(FixPoint16 left, SFixPointVector3 right)
{
return Divide(left, right);
}
#endregion
/// <summary>
/// The x-component of the vector.
/// </summary>
public FixPoint16 m_X;
/// <summary>
/// The y-component of the vector.
/// </summary>
public FixPoint16 m_Y;
/// <summary>
/// The z-component of the vector.
/// </summary>
public FixPoint16 m_Z;
}

View File

@@ -0,0 +1,34 @@
namespace SideScrollerGame.Sim.Math;
internal static class IntMath
{
public static int Sign(int value)
{
return System.Math.Sign(value);
}
public static int Abs(int value)
{
return System.Math.Abs(value);
}
public static int Min(int left, int right)
{
return System.Math.Min(left, right);
}
public static int Max(int left, int right)
{
return System.Math.Max(left, right);
}
public static int Clamp(int value, int min, int max)
{
return System.Math.Clamp(value, min, max);
}
public static long Sqrt(long value)
{
return (long)System.Math.Sqrt(value);
}
}

View File

@@ -0,0 +1,119 @@
using System;
namespace SideScrollerGame.Sim.Math;
/// <summary>
/// Implements a XorShift* PRNG, with 64 bits of internal state.
/// See http://en.wikipedia.org/wiki/Xorshift
/// </summary>
public struct SIntRandom
{
public SIntRandom(ulong seed)
{
if (seed == 0)
throw new InvalidOperationException("Seed needs to be bigger than zero.");
m_Seed = seed;
}
public ulong Next()
{
m_Seed ^= m_Seed >> 12;
m_Seed ^= m_Seed << 25;
m_Seed ^= m_Seed >> 27;
return m_Seed * 2685821657736338717UL; // multiplier taken from wikipedia article on XorShift PRNGs
}
public ulong Next(ulong upperLimit)
{
if (upperLimit == 0)
{
return 0;
}
return Next() % upperLimit;
}
public FixPoint16 NextFixPoint16()
{
return new() { m_Value = (int)(Next() & 0xffffUL) };
}
public int RandomizedRound(FixPoint16 value)
{
int ret = value.ToIntFloor();
if (NextFixPoint16() < FixPoint16.Fract(value))
ret++;
return ret;
}
public uint Next(uint upperLimit)
{
if (upperLimit == 0)
{
return 0;
}
return (uint)(Next() % upperLimit);
}
public uint Next(uint lowerLimit, uint upperLimit)
{
if (upperLimit == 0)
{
return 0;
}
if (lowerLimit == upperLimit)
{
return lowerLimit;
}
return lowerLimit + (uint)(Next() % (upperLimit - lowerLimit));
}
public int Next(int upperLimit)
{
if (upperLimit == 0)
{
return 0;
}
return (int)(Next() % (uint)(upperLimit & 0x7fffffff));
}
public int Next(int lowerLimit, int upperLimit)
{
if (upperLimit == 0)
{
return 0;
}
if (lowerLimit == upperLimit)
{
return lowerLimit;
}
return lowerLimit + (int)(Next() % (uint)((upperLimit - lowerLimit) & 0x7fffffff));
}
public double NextDouble()
{
return Next(int.MaxValue) * (1.0 / int.MaxValue);
}
public float NextSingle()
{
return (float)NextDouble();
}
public override readonly string ToString()
{
return $"0x{m_Seed:X}";
}
public readonly ulong Seed => m_Seed;
private ulong m_Seed;
}

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"SideScrollerGame.Sim/1.0.0": {
"runtime": {
"SideScrollerGame.Sim.dll": {}
}
}
}
},
"libraries": {
"SideScrollerGame.Sim/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("SideScrollerGame.Sim")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4c4089a57b0f04a3ddf2e14a113984c00c33f4fc")]
[assembly: System.Reflection.AssemblyProductAttribute("SideScrollerGame.Sim")]
[assembly: System.Reflection.AssemblyTitleAttribute("SideScrollerGame.Sim")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@@ -0,0 +1 @@
a1b961817e5e8e42a1859fc05fe322422760b8a7ba028cf04c475b2fe731b944

View File

@@ -0,0 +1,17 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetFrameworkIdentifier = .NETCoreApp
build_property.TargetFrameworkVersion = v8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = SideScrollerGame.Sim
build_property.ProjectDir = D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =

View File

@@ -0,0 +1,8 @@
// <auto-generated/>
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Net.Http;
global using System.Threading;
global using System.Threading.Tasks;

View File

@@ -0,0 +1 @@
796e1bf0ec3da7a2837388ffa742b069061c03c3b32749b5f0f5b5383c28ce09

View File

@@ -0,0 +1,11 @@
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\obj\Debug\net8.0\SideScrollerGame.Sim.GeneratedMSBuildEditorConfig.editorconfig
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\obj\Debug\net8.0\SideScrollerGame.Sim.AssemblyInfoInputs.cache
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\obj\Debug\net8.0\SideScrollerGame.Sim.AssemblyInfo.cs
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\obj\Debug\net8.0\SideScrollerGame.Sim.csproj.CoreCompileInputs.cache
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\bin\Debug\net8.0\SideScrollerGame.Sim.deps.json
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\bin\Debug\net8.0\SideScrollerGame.Sim.dll
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\bin\Debug\net8.0\SideScrollerGame.Sim.pdb
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\obj\Debug\net8.0\SideScrollerGame.Sim.dll
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\obj\Debug\net8.0\refint\SideScrollerGame.Sim.dll
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\obj\Debug\net8.0\SideScrollerGame.Sim.pdb
D:\Code\SideScrollerGame\src\SideScrollerGame.Sim\obj\Debug\net8.0\ref\SideScrollerGame.Sim.dll

View File

@@ -0,0 +1,73 @@
{
"format": 1,
"restore": {
"D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\SideScrollerGame.Sim.csproj": {}
},
"projects": {
"D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\SideScrollerGame.Sim.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\SideScrollerGame.Sim.csproj",
"projectName": "SideScrollerGame.Sim",
"projectPath": "D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\SideScrollerGame.Sim.csproj",
"packagesPath": "C:\\Users\\frank\\.nuget\\packages\\",
"outputPath": "D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\frank\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.100"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.102/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\frank\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\frank\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -0,0 +1,79 @@
{
"version": 3,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"C:\\Users\\frank\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\SideScrollerGame.Sim.csproj",
"projectName": "SideScrollerGame.Sim",
"projectPath": "D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\SideScrollerGame.Sim.csproj",
"packagesPath": "C:\\Users\\frank\\.nuget\\packages\\",
"outputPath": "D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\frank\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.100"
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.102/PortableRuntimeIdentifierGraph.json"
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "peCFRDEJgdg=",
"success": true,
"projectFilePath": "D:\\Code\\SideScrollerGame\\src\\SideScrollerGame.Sim\\SideScrollerGame.Sim.csproj",
"expectedPackageFiles": [],
"logs": []
}

View File

@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SideScrollerGame.Sim\SideScrollerGame.Sim.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,16 @@
using SideScrollerGame.Sim.Math;
namespace SideScrollerGame.Sim.Tests;
public sealed class DeterministicMathSmokeTests
{
[Fact]
public void FixPointAverage_UsesSimulationMathTypes()
{
FixPoint16[] values = [new(1), new(2), new(3)];
var average = values.Average();
Assert.Equal(new(2), average);
}
}

View File

@@ -0,0 +1,451 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"SideScrollerGame.Sim.Tests/1.0.0": {
"dependencies": {
"Microsoft.NET.Test.Sdk": "17.8.0",
"SideScrollerGame.Sim": "1.0.0",
"xunit": "2.5.3"
},
"runtime": {
"SideScrollerGame.Sim.Tests.dll": {}
}
},
"Microsoft.CodeCoverage/17.8.0": {
"runtime": {
"lib/netcoreapp3.1/Microsoft.VisualStudio.CodeCoverage.Shim.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.623.45702"
}
}
},
"Microsoft.NET.Test.Sdk/17.8.0": {
"dependencies": {
"Microsoft.CodeCoverage": "17.8.0",
"Microsoft.TestPlatform.TestHost": "17.8.0"
}
},
"Microsoft.TestPlatform.ObjectModel/17.8.0": {
"dependencies": {
"NuGet.Frameworks": "6.5.0"
},
"runtime": {
"lib/netcoreapp3.1/Microsoft.TestPlatform.CoreUtilities.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.23.55801"
},
"lib/netcoreapp3.1/Microsoft.TestPlatform.PlatformAbstractions.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.23.55801"
},
"lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.23.55801"
}
},
"resources": {
"lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "cs"
},
"lib/netcoreapp3.1/cs/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "cs"
},
"lib/netcoreapp3.1/de/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "de"
},
"lib/netcoreapp3.1/de/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "de"
},
"lib/netcoreapp3.1/es/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "es"
},
"lib/netcoreapp3.1/es/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "es"
},
"lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "fr"
},
"lib/netcoreapp3.1/fr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "fr"
},
"lib/netcoreapp3.1/it/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "it"
},
"lib/netcoreapp3.1/it/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "it"
},
"lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "ja"
},
"lib/netcoreapp3.1/ja/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "ja"
},
"lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "ko"
},
"lib/netcoreapp3.1/ko/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "ko"
},
"lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "pl"
},
"lib/netcoreapp3.1/pl/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "pl"
},
"lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "pt-BR"
},
"lib/netcoreapp3.1/pt-BR/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "pt-BR"
},
"lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "ru"
},
"lib/netcoreapp3.1/ru/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "ru"
},
"lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "tr"
},
"lib/netcoreapp3.1/tr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "tr"
},
"lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "zh-Hans"
},
"lib/netcoreapp3.1/zh-Hans/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "zh-Hans"
},
"lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CoreUtilities.resources.dll": {
"locale": "zh-Hant"
},
"lib/netcoreapp3.1/zh-Hant/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll": {
"locale": "zh-Hant"
}
}
},
"Microsoft.TestPlatform.TestHost/17.8.0": {
"dependencies": {
"Microsoft.TestPlatform.ObjectModel": "17.8.0",
"Newtonsoft.Json": "13.0.1"
},
"runtime": {
"lib/netcoreapp3.1/Microsoft.TestPlatform.CommunicationUtilities.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.23.55801"
},
"lib/netcoreapp3.1/Microsoft.TestPlatform.CrossPlatEngine.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.23.55801"
},
"lib/netcoreapp3.1/Microsoft.TestPlatform.Utilities.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.23.55801"
},
"lib/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.Common.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.23.55801"
},
"lib/netcoreapp3.1/testhost.dll": {
"assemblyVersion": "15.0.0.0",
"fileVersion": "17.800.23.55801"
}
},
"resources": {
"lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "cs"
},
"lib/netcoreapp3.1/cs/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "cs"
},
"lib/netcoreapp3.1/cs/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "cs"
},
"lib/netcoreapp3.1/de/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "de"
},
"lib/netcoreapp3.1/de/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "de"
},
"lib/netcoreapp3.1/de/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "de"
},
"lib/netcoreapp3.1/es/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "es"
},
"lib/netcoreapp3.1/es/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "es"
},
"lib/netcoreapp3.1/es/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "es"
},
"lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "fr"
},
"lib/netcoreapp3.1/fr/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "fr"
},
"lib/netcoreapp3.1/fr/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "fr"
},
"lib/netcoreapp3.1/it/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "it"
},
"lib/netcoreapp3.1/it/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "it"
},
"lib/netcoreapp3.1/it/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "it"
},
"lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "ja"
},
"lib/netcoreapp3.1/ja/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "ja"
},
"lib/netcoreapp3.1/ja/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "ja"
},
"lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "ko"
},
"lib/netcoreapp3.1/ko/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "ko"
},
"lib/netcoreapp3.1/ko/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "ko"
},
"lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "pl"
},
"lib/netcoreapp3.1/pl/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "pl"
},
"lib/netcoreapp3.1/pl/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "pl"
},
"lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "pt-BR"
},
"lib/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "pt-BR"
},
"lib/netcoreapp3.1/pt-BR/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "pt-BR"
},
"lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "ru"
},
"lib/netcoreapp3.1/ru/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "ru"
},
"lib/netcoreapp3.1/ru/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "ru"
},
"lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "tr"
},
"lib/netcoreapp3.1/tr/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "tr"
},
"lib/netcoreapp3.1/tr/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "tr"
},
"lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "zh-Hans"
},
"lib/netcoreapp3.1/zh-Hans/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "zh-Hans"
},
"lib/netcoreapp3.1/zh-Hans/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "zh-Hans"
},
"lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CommunicationUtilities.resources.dll": {
"locale": "zh-Hant"
},
"lib/netcoreapp3.1/zh-Hant/Microsoft.TestPlatform.CrossPlatEngine.resources.dll": {
"locale": "zh-Hant"
},
"lib/netcoreapp3.1/zh-Hant/Microsoft.VisualStudio.TestPlatform.Common.resources.dll": {
"locale": "zh-Hant"
}
}
},
"Newtonsoft.Json/13.0.1": {
"runtime": {
"lib/netstandard2.0/Newtonsoft.Json.dll": {
"assemblyVersion": "13.0.0.0",
"fileVersion": "13.0.1.25517"
}
}
},
"NuGet.Frameworks/6.5.0": {
"runtime": {
"lib/netstandard2.0/NuGet.Frameworks.dll": {
"assemblyVersion": "6.5.0.154",
"fileVersion": "6.5.0.154"
}
}
},
"xunit/2.5.3": {
"dependencies": {
"xunit.assert": "2.5.3",
"xunit.core": "2.5.3"
}
},
"xunit.abstractions/2.0.3": {
"runtime": {
"lib/netstandard2.0/xunit.abstractions.dll": {
"assemblyVersion": "2.0.0.0",
"fileVersion": "2.0.0.0"
}
}
},
"xunit.assert/2.5.3": {
"runtime": {
"lib/netstandard1.1/xunit.assert.dll": {
"assemblyVersion": "2.5.3.0",
"fileVersion": "2.5.3.0"
}
}
},
"xunit.core/2.5.3": {
"dependencies": {
"xunit.extensibility.core": "2.5.3",
"xunit.extensibility.execution": "2.5.3"
}
},
"xunit.extensibility.core/2.5.3": {
"dependencies": {
"xunit.abstractions": "2.0.3"
},
"runtime": {
"lib/netstandard1.1/xunit.core.dll": {
"assemblyVersion": "2.5.3.0",
"fileVersion": "2.5.3.0"
}
}
},
"xunit.extensibility.execution/2.5.3": {
"dependencies": {
"xunit.extensibility.core": "2.5.3"
},
"runtime": {
"lib/netstandard1.1/xunit.execution.dotnet.dll": {
"assemblyVersion": "2.5.3.0",
"fileVersion": "2.5.3.0"
}
}
},
"SideScrollerGame.Sim/1.0.0": {
"runtime": {
"SideScrollerGame.Sim.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
}
}
},
"libraries": {
"SideScrollerGame.Sim.Tests/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Microsoft.CodeCoverage/17.8.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-KC8SXWbGIdoFVdlxKk9WHccm0llm9HypcHMLUUFabRiTS3SO2fQXNZfdiF3qkEdTJhbRrxhdRxjL4jbtwPq4Ew==",
"path": "microsoft.codecoverage/17.8.0",
"hashPath": "microsoft.codecoverage.17.8.0.nupkg.sha512"
},
"Microsoft.NET.Test.Sdk/17.8.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-BmTYGbD/YuDHmApIENdoyN1jCk0Rj1fJB0+B/fVekyTdVidr91IlzhqzytiUgaEAzL1ZJcYCme0MeBMYvJVzvw==",
"path": "microsoft.net.test.sdk/17.8.0",
"hashPath": "microsoft.net.test.sdk.17.8.0.nupkg.sha512"
},
"Microsoft.TestPlatform.ObjectModel/17.8.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-AYy6vlpGMfz5kOFq99L93RGbqftW/8eQTqjT9iGXW6s9MRP3UdtY8idJ8rJcjeSja8A18IhIro5YnH3uv1nz4g==",
"path": "microsoft.testplatform.objectmodel/17.8.0",
"hashPath": "microsoft.testplatform.objectmodel.17.8.0.nupkg.sha512"
},
"Microsoft.TestPlatform.TestHost/17.8.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-9ivcl/7SGRmOT0YYrHQGohWiT5YCpkmy/UEzldfVisLm6QxbLaK3FAJqZXI34rnRLmqqDCeMQxKINwmKwAPiDw==",
"path": "microsoft.testplatform.testhost/17.8.0",
"hashPath": "microsoft.testplatform.testhost.17.8.0.nupkg.sha512"
},
"Newtonsoft.Json/13.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==",
"path": "newtonsoft.json/13.0.1",
"hashPath": "newtonsoft.json.13.0.1.nupkg.sha512"
},
"NuGet.Frameworks/6.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-QWINE2x3MbTODsWT1Gh71GaGb5icBz4chS8VYvTgsBnsi8esgN6wtHhydd7fvToWECYGq7T4cgBBDiKD/363fg==",
"path": "nuget.frameworks/6.5.0",
"hashPath": "nuget.frameworks.6.5.0.nupkg.sha512"
},
"xunit/2.5.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-VxYDiWSwrLxOJ3UEN+ZPrBybB0SFShQ1E6PjT65VdoKCJhorgerFznThjSwawRH/WAip73YnucDVsE8WRj/8KQ==",
"path": "xunit/2.5.3",
"hashPath": "xunit.2.5.3.nupkg.sha512"
},
"xunit.abstractions/2.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg==",
"path": "xunit.abstractions/2.0.3",
"hashPath": "xunit.abstractions.2.0.3.nupkg.sha512"
},
"xunit.assert/2.5.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-MK3HiBckO3vdxEdUxXZyyRPsBNPsC/nz6y1gj/UZIZkjMnsVQyZPU8yxS/3cjTchYcqskt/nqUOS5wmD8JezdQ==",
"path": "xunit.assert/2.5.3",
"hashPath": "xunit.assert.2.5.3.nupkg.sha512"
},
"xunit.core/2.5.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-FE8yEEUkoMLd6kOHDXm/QYfX/dYzwc0c+Q4MQon6VGRwFuy6UVGwK/CFA5LEea+ZBEmcco7AEl2q78VjsA0j/w==",
"path": "xunit.core/2.5.3",
"hashPath": "xunit.core.2.5.3.nupkg.sha512"
},
"xunit.extensibility.core/2.5.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-IjAQlPeZWXP89pl1EuOG9991GH1qgAL0rQfkmX2UV+PDenbYb7oBnQopL9ujE6YaXxgaQazp7lFjsDyyxD6Mtw==",
"path": "xunit.extensibility.core/2.5.3",
"hashPath": "xunit.extensibility.core.2.5.3.nupkg.sha512"
},
"xunit.extensibility.execution/2.5.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-w9eGCHl+gJj1GzZSf0VTzYPp/gv4fiUDkr+yR7/Wv9/ucO2CHltGg2TnyySLFjzekkjuxVJZUE+tZyDNzryJFw==",
"path": "xunit.extensibility.execution/2.5.3",
"hashPath": "xunit.extensibility.execution.2.5.3.nupkg.sha512"
},
"SideScrollerGame.Sim/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

View File

@@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

Some files were not shown because too many files have changed in this diff Show More