mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Add deep cloning support to Score
/ScoreInfo
/Replay
This commit is contained in:
@ -2,11 +2,13 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Rulesets.Replays;
|
||||
using osu.Game.Utils;
|
||||
|
||||
namespace osu.Game.Replays
|
||||
{
|
||||
public class Replay
|
||||
public class Replay : IDeepCloneable<Replay>
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether all frames for this replay have been received.
|
||||
@ -15,5 +17,15 @@ namespace osu.Game.Replays
|
||||
public bool HasReceivedAllFrames = true;
|
||||
|
||||
public List<ReplayFrame> Frames = new List<ReplayFrame>();
|
||||
|
||||
public Replay DeepClone()
|
||||
{
|
||||
return new Replay
|
||||
{
|
||||
HasReceivedAllFrames = HasReceivedAllFrames,
|
||||
// individual frames are mutable for now but hopefully this will not be a thing in the future.
|
||||
Frames = Frames.ToList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user