Add IDeepCloneable interface and update existing CreateCopy methods to use it

This commit is contained in:
Dean Herbert
2021-07-19 12:38:22 +09:00
parent 48b34457e7
commit 3c028ce05c
16 changed files with 45 additions and 25 deletions

View File

@ -0,0 +1,16 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Utils
{
/// <summary>A generic interface for a deeply cloneable type.</summary>
/// <typeparam name="T">The type of object to clone.</typeparam>
public interface IDeepCloneable<out T> where T : class
{
/// <summary>
/// Creates a new <typeparamref name="T" /> that is a deep copy of the current instance.
/// </summary>
/// <returns>The <typeparamref name="T" />.</returns>
T DeepClone();
}
}