osu/osu.Game/Online/Spectator/FrameDataBundle.cs

39 lines
969 B
C#
Raw Normal View History

2020-10-22 10:41:10 +00:00
// 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.
#nullable enable
using System;
using System.Collections.Generic;
using MessagePack;
2020-12-14 09:41:24 +00:00
using Newtonsoft.Json;
using osu.Game.Replays.Legacy;
using osu.Game.Scoring;
namespace osu.Game.Online.Spectator
{
[Serializable]
[MessagePackObject]
public class FrameDataBundle
{
[Key(0)]
public FrameHeader Header { get; set; }
[Key(1)]
public IEnumerable<LegacyReplayFrame> Frames { get; set; }
public FrameDataBundle(ScoreInfo score, IEnumerable<LegacyReplayFrame> frames)
{
Frames = frames;
Header = new FrameHeader(score);
}
2020-12-14 09:41:24 +00:00
[JsonConstructor]
public FrameDataBundle(FrameHeader header, IEnumerable<LegacyReplayFrame> frames)
{
Header = header;
Frames = frames;
}
}
}