Skip to content

Commit

Permalink
Merge pull request #158 from Emik03/deepcloner
Browse files Browse the repository at this point in the history
Migrate to DeepCloner
  • Loading branch information
Warp9000 authored Apr 10, 2024
2 parents 783211e + ad06e86 commit 9d20659
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
26 changes: 0 additions & 26 deletions Quaver.API/Helpers/Objects.cs

This file was deleted.

9 changes: 5 additions & 4 deletions Quaver.API/Maps/Qua.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Linq;
using System.Reflection;
using System.Text;
using Force.DeepCloner;
using MonoGame.Extended.Collections;
using Quaver.API.Enums;
using Quaver.API.Helpers;
Expand Down Expand Up @@ -353,7 +354,7 @@ public string Serialize()
// the bookmarks in the file.
if (Bookmarks.Count == 0)
Bookmarks = null;

var serializer = new Serializer();
var stringWriter = new StringWriter {NewLine = "\r\n"};
serializer.Serialize(stringWriter, this);
Expand Down Expand Up @@ -629,7 +630,7 @@ public DifficultyProcessor SolveDifficulty(ModIdentifier mods = ModIdentifier.No
// Create a new version of the qua with modifiers applied, and use that for calculations.
if (applyMods)
{
qua = Objects.DeepClone(qua);
qua = qua.DeepClone();
qua.ApplyMods(mods);
}

Expand Down Expand Up @@ -952,7 +953,7 @@ public void RandomizeLanes(int seed)
public void MirrorHitObjects()
{
var keyCount = GetKeyCount();

for (var i = 0; i < HitObjects.Count; i++)
{
var temp = HitObjects[i];
Expand Down Expand Up @@ -1400,4 +1401,4 @@ public string GetAudioPath()
return $"{Path.GetDirectoryName(FilePath)}/{AudioFile}";
}
}
}
}
3 changes: 2 additions & 1 deletion Quaver.API/Quaver.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<EmbeddedResource Include="Resources\**\*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DeepCloner" Version="0.10.4" />
<PackageReference Include="HoLLy.osu.DatabaseReader" Version="2.1.0" />
<PackageReference Include="MonoGame.Extended" Version="1.1.0" />
<PackageReference Include="MoonSharp" Version="2.0.0" />
Expand All @@ -21,4 +22,4 @@
<PackageReference Include="YamlDotNet" Version="5.1.0" />
<PackageReference Include="z440.atl.core" Version="3.18.0" />
</ItemGroup>
</Project>
</Project>

0 comments on commit 9d20659

Please sign in to comment.