1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-16 05:37:19 +08:00

Rename differ to patcher, add xmldoc

This commit is contained in:
Dean Herbert 2020-04-13 17:20:01 +09:00
parent bb53f96c71
commit 6aab19413c
3 changed files with 12 additions and 9 deletions

View File

@ -20,15 +20,15 @@ using Decoder = osu.Game.Beatmaps.Formats.Decoder;
namespace osu.Game.Tests.Editor
{
[TestFixture]
public class LegacyEditorBeatmapDifferTest
public class LegacyEditorBeatmapPatcherTest
{
private LegacyEditorBeatmapDiffer differ;
private LegacyEditorBeatmapPatcher patcher;
private EditorBeatmap current;
[SetUp]
public void Setup()
{
differ = new LegacyEditorBeatmapDiffer(current = new EditorBeatmap(new OsuBeatmap
patcher = new LegacyEditorBeatmapPatcher(current = new EditorBeatmap(new OsuBeatmap
{
BeatmapInfo =
{
@ -312,7 +312,7 @@ namespace osu.Game.Tests.Editor
patch = decode(encode(patch));
// Apply the patch.
differ.Patch(encode(current), encode(patch));
patcher.Patch(encode(current), encode(patch));
// Convert beatmaps to strings for assertion purposes.
string currentStr = Encoding.ASCII.GetString(encode(current));

View File

@ -15,7 +15,7 @@ namespace osu.Game.Screens.Edit
/// </summary>
public class EditorChangeHandler : IEditorChangeHandler
{
private readonly LegacyEditorBeatmapDiffer differ;
private readonly LegacyEditorBeatmapPatcher patcher;
private readonly List<byte[]> savedStates = new List<byte[]>();
@ -37,7 +37,7 @@ namespace osu.Game.Screens.Edit
editorBeatmap.HitObjectRemoved += hitObjectRemoved;
editorBeatmap.HitObjectUpdated += hitObjectUpdated;
differ = new LegacyEditorBeatmapDiffer(editorBeatmap);
patcher = new LegacyEditorBeatmapPatcher(editorBeatmap);
// Initial state.
SaveState();
@ -103,7 +103,7 @@ namespace osu.Game.Screens.Edit
isRestoring = true;
differ.Patch(savedStates[currentState], savedStates[newState]);
patcher.Patch(savedStates[currentState], savedStates[newState]);
currentState = newState;
isRestoring = false;

View File

@ -14,11 +14,14 @@ using Decoder = osu.Game.Beatmaps.Formats.Decoder;
namespace osu.Game.Screens.Edit
{
public class LegacyEditorBeatmapDiffer
/// <summary>
/// Patches an <see cref="EditorBeatmap"/> based on the difference between two legacy (.osu) states.
/// </summary>
public class LegacyEditorBeatmapPatcher
{
private readonly EditorBeatmap editorBeatmap;
public LegacyEditorBeatmapDiffer(EditorBeatmap editorBeatmap)
public LegacyEditorBeatmapPatcher(EditorBeatmap editorBeatmap)
{
this.editorBeatmap = editorBeatmap;
}