Skip to content

Commit

Permalink
update todos and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Jamrozik committed Jan 2, 2024
1 parent 86250d3 commit 4a8ef57
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
12 changes: 4 additions & 8 deletions src/game-lib-tests/GameSessionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public void Setup()
}

// kja3 overall work plan:
// implement first AIPlayer
//
// reimplement a bit more logic
// implement charts in frontend instead of excel. chartjs.org etc.
//
// reimplement a bit more logic in the AIPlayer
// start by adding new capabilities to AIPlayer (as if it tried to do a new thing) and implement going from there.
//
// implement IPersistable
Expand All @@ -39,12 +40,6 @@ public void Setup()
//
// generate API Controller methods for REST API generation
//
// deploy the game server with REST API locally
//
// deploy the game server with REST API to Azure
//
// generate swagger UI from the controller methods
//
// when available, interface with the swagger UI via LLM, or with CLI by using GH CLI Copilot
//
// Test strategy:
Expand Down Expand Up @@ -248,6 +243,7 @@ public void RoundTrippingSavingAndLoadingGameStateWithActiveMissionBehavesCorrec
}


// kja review and consolidate VerifyGameSatesByJsonDiff
private static void VerifyGameSatesByJsonDiff(GameSessionController controller)
{
// Act 1/2 and 2/2
Expand Down
4 changes: 0 additions & 4 deletions src/game-lib-tests/GameStateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ public void CloningAndViewAndEqualityBehaveCorrectly()

Assert.Multiple(() =>
{
// kja implement IEquatable so this Is.EqualTo works as expected.
// See VerifyGameStatesByJsonDiff
// See usage of clone in AddCurrentStateToPastStates
// See CurrentGameStateSerializedAsJsonString
// Act: exercise game state equality
Assert.That(clonedState, Is.EqualTo(originalGameState));

Expand Down
3 changes: 2 additions & 1 deletion src/game-lib/Controller/GameSessionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void PlayGameSession(int turnLimit, IPlayer player)
public void AdvanceTime()
=> PlayerActions.Apply(new AdvanceTimePlayerAction(_log, GameSession.RandomGen), GameSession.CurrentGameState);

// kja3 introduce "SerializedJsonFile" abstraction that will retain the serialization options
// kja introduce "SerializedJsonFile" abstraction that will retain the serialization options
public GameState SaveCurrentGameStateToFile()
{
_config.SaveFile.WriteAllText(CurrentGameStateSerializedAsJsonString());
Expand Down Expand Up @@ -175,6 +175,7 @@ private void DiffPreviousAndCurrentGameState()
new GameStateDiff(prev, curr).PrintTo(_log);
}

// kja review and consolidate CurrentGameStateSerializedAsJsonString
private string CurrentGameStateSerializedAsJsonString()
=> GameSession.CurrentGameState.ToIndentedUnsafeJsonString(GameState.StateJsonSerializerOptions);
}
2 changes: 1 addition & 1 deletion src/game-lib/Lib/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ public Configuration(IFileSystem fs)
TurnReportCsvFile = new File(saveFileDir, "turns_report.csv");
AgentReportCsvFile = new File(saveFileDir, "agents_report.csv");
MissionSiteReportCsvFile = new File(saveFileDir, "mission_sites_report.csv");
// kja3 should have method here that returns handle to Lib.OS.File represented by SaveFileName
// kja should have method here that returns handle to Lib.OS.File represented by SaveFileName
}
}

0 comments on commit 4a8ef57

Please sign in to comment.