mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Rename differ to patcher, add xmldoc
This commit is contained in:
@ -20,15 +20,15 @@ using Decoder = osu.Game.Beatmaps.Formats.Decoder;
|
|||||||
namespace osu.Game.Tests.Editor
|
namespace osu.Game.Tests.Editor
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class LegacyEditorBeatmapDifferTest
|
public class LegacyEditorBeatmapPatcherTest
|
||||||
{
|
{
|
||||||
private LegacyEditorBeatmapDiffer differ;
|
private LegacyEditorBeatmapPatcher patcher;
|
||||||
private EditorBeatmap current;
|
private EditorBeatmap current;
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
differ = new LegacyEditorBeatmapDiffer(current = new EditorBeatmap(new OsuBeatmap
|
patcher = new LegacyEditorBeatmapPatcher(current = new EditorBeatmap(new OsuBeatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo =
|
BeatmapInfo =
|
||||||
{
|
{
|
||||||
@ -312,7 +312,7 @@ namespace osu.Game.Tests.Editor
|
|||||||
patch = decode(encode(patch));
|
patch = decode(encode(patch));
|
||||||
|
|
||||||
// Apply the patch.
|
// Apply the patch.
|
||||||
differ.Patch(encode(current), encode(patch));
|
patcher.Patch(encode(current), encode(patch));
|
||||||
|
|
||||||
// Convert beatmaps to strings for assertion purposes.
|
// Convert beatmaps to strings for assertion purposes.
|
||||||
string currentStr = Encoding.ASCII.GetString(encode(current));
|
string currentStr = Encoding.ASCII.GetString(encode(current));
|
@ -15,7 +15,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class EditorChangeHandler : IEditorChangeHandler
|
public class EditorChangeHandler : IEditorChangeHandler
|
||||||
{
|
{
|
||||||
private readonly LegacyEditorBeatmapDiffer differ;
|
private readonly LegacyEditorBeatmapPatcher patcher;
|
||||||
|
|
||||||
private readonly List<byte[]> savedStates = new List<byte[]>();
|
private readonly List<byte[]> savedStates = new List<byte[]>();
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
editorBeatmap.HitObjectRemoved += hitObjectRemoved;
|
editorBeatmap.HitObjectRemoved += hitObjectRemoved;
|
||||||
editorBeatmap.HitObjectUpdated += hitObjectUpdated;
|
editorBeatmap.HitObjectUpdated += hitObjectUpdated;
|
||||||
|
|
||||||
differ = new LegacyEditorBeatmapDiffer(editorBeatmap);
|
patcher = new LegacyEditorBeatmapPatcher(editorBeatmap);
|
||||||
|
|
||||||
// Initial state.
|
// Initial state.
|
||||||
SaveState();
|
SaveState();
|
||||||
@ -103,7 +103,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
isRestoring = true;
|
isRestoring = true;
|
||||||
|
|
||||||
differ.Patch(savedStates[currentState], savedStates[newState]);
|
patcher.Patch(savedStates[currentState], savedStates[newState]);
|
||||||
currentState = newState;
|
currentState = newState;
|
||||||
|
|
||||||
isRestoring = false;
|
isRestoring = false;
|
||||||
|
@ -14,11 +14,14 @@ using Decoder = osu.Game.Beatmaps.Formats.Decoder;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Edit
|
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;
|
private readonly EditorBeatmap editorBeatmap;
|
||||||
|
|
||||||
public LegacyEditorBeatmapDiffer(EditorBeatmap editorBeatmap)
|
public LegacyEditorBeatmapPatcher(EditorBeatmap editorBeatmap)
|
||||||
{
|
{
|
||||||
this.editorBeatmap = editorBeatmap;
|
this.editorBeatmap = editorBeatmap;
|
||||||
}
|
}
|
Reference in New Issue
Block a user