From 04f9a2a9631ede0adf465767b7d8a0a65902cc3f Mon Sep 17 00:00:00 2001 From: David Fidge Date: Fri, 31 Mar 2023 20:53:43 +1030 Subject: [PATCH] Fix issue with loading games due to breed names needing to use the new non-space format. Fix 2 other tests with incorrect asserts. --- MarsUndiscovered.Tests/Commands/WalkCommandTests.cs | 2 +- .../Components/GameWorldTests/MonsterGoalTests.cs | 4 ++-- MarsUndiscovered/Components/Monster.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MarsUndiscovered.Tests/Commands/WalkCommandTests.cs b/MarsUndiscovered.Tests/Commands/WalkCommandTests.cs index 3922da87..a7dcbe97 100644 --- a/MarsUndiscovered.Tests/Commands/WalkCommandTests.cs +++ b/MarsUndiscovered.Tests/Commands/WalkCommandTests.cs @@ -143,7 +143,7 @@ public void WalkCommand_Player_Into_Monster_On_Wall_Should_Attack() Assert.AreEqual(CommandResultEnum.Success, attackCommand.CommandResult.Result); Assert.IsTrue(monster.Health < healthBefore); - Assert.AreEqual("You hit the tesla coil", attackCommand.CommandResult.Messages[0]); + Assert.AreEqual("You hit the tesla turret", attackCommand.CommandResult.Messages[0]); } [TestMethod] diff --git a/MarsUndiscovered.Tests/Components/GameWorldTests/MonsterGoalTests.cs b/MarsUndiscovered.Tests/Components/GameWorldTests/MonsterGoalTests.cs index ed507744..3244ac71 100644 --- a/MarsUndiscovered.Tests/Components/GameWorldTests/MonsterGoalTests.cs +++ b/MarsUndiscovered.Tests/Components/GameWorldTests/MonsterGoalTests.cs @@ -505,7 +505,7 @@ public void Should_Progress_On_Path_Towards_Unexplored_Region() mapGenerator.OutdoorMapDimensions = new Point(4, 5); NewGameWithCustomMapNoMonstersNoItemsNoExitsNoStructures(mapGenerator); - + // ..#@ // .### // .... @@ -517,7 +517,7 @@ public void Should_Progress_On_Path_Towards_Unexplored_Region() _gameWorld.CreateWall(1, 1); _gameWorld.CreateWall(2, 1); _gameWorld.CreateWall(3, 1); - _gameWorld.CreateWall(0, 2); + _gameWorld.CreateWall(2, 0); _gameWorld.SpawnMonster(new SpawnMonsterParams().WithBreed("Roach").AtPosition(new Point(2, 4))); var monster = _gameWorld.Monsters.Values.First(); diff --git a/MarsUndiscovered/Components/Monster.cs b/MarsUndiscovered/Components/Monster.cs index f9a1e004..980208c9 100644 --- a/MarsUndiscovered/Components/Monster.cs +++ b/MarsUndiscovered/Components/Monster.cs @@ -159,7 +159,7 @@ public IMemento GetSaveState() base.PopulateSaveState(memento.State); - memento.State.BreedName = Breed.Name; + memento.State.BreedName = Breed.NameWithoutSpaces; memento.State.WanderPath = _wanderPath?.Steps.ToList(); memento.State.UseGoalMapWander = UseGoalMapWander;