Skip to content

Commit

Permalink
Record recipe data serialization (#47)
Browse files Browse the repository at this point in the history
* feat: initial recipe serialization testing

* feat: recipe serialize record refactor polymorphism

* fix: revert old polymorphism serialization fix

* fix: merge fixes
  • Loading branch information
Chillu1 authored Aug 3, 2024
1 parent 3b0ef58 commit 4b0df1b
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="7.0.3"/>
<PackageReference Include="System.Text.Json" Version="8.0.4"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ModiBuff.Units\ModiBuff.Units.csproj"/>
<ProjectReference Include="..\ModiBuff\ModiBuff.csproj"/>
</ItemGroup>

</Project>
</Project>
5 changes: 2 additions & 3 deletions ModiBuff/ModiBuff.Tests/SaveLoadRecipeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,15 @@ public void SaveRemoveCallbackUnitRecipeLoad()
{
var saveRecipes = new ModifierRecipes(IdManager, EffectTypeIdManager);
saveRecipes.Add("InitAddDamageRevertibleCallback")
.Tag(ModiBuff.Core.Units.TagType.StrongDispel)
.Dispel(DispelType.Strong)
.Effect(new AddDamageEffect(5, EffectState.IsRevertible), EffectOn.Init)
.Remove(RemoveEffectOn.CallbackUnit)
.CallbackUnit(CallbackUnitType.StrongDispel);

SaveLoadStateAndSetup(saveRecipes);

Unit.AddModifierSelf("InitAddDamageRevertibleCallback");
Assert.AreEqual(UnitDamage + 5, Unit.Damage);
Unit.StrongDispel(Unit);
Unit.Dispel(DispelType.Strong, Unit);
Assert.AreEqual(UnitDamage, Unit.Damage);
}

Expand Down
2 changes: 1 addition & 1 deletion ModiBuff/ModiBuff.Units/ModiBuff.Units.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Text.Json" Version="7.0.3"/>
<PackageReference Include="System.Text.Json" Version="8.0.4"/>
</ItemGroup>

</Project>
Loading

0 comments on commit 4b0df1b

Please sign in to comment.