2020-10-22 18:41:10 +08: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.
|
|
|
|
|
2020-10-21 18:05:20 +08:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2021-01-26 15:39:35 +08:00
|
|
|
using MessagePack;
|
2020-12-14 17:41:24 +08:00
|
|
|
using Newtonsoft.Json;
|
2020-10-21 18:05:20 +08:00
|
|
|
using osu.Game.Replays.Legacy;
|
2023-05-19 15:25:52 +08:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2020-12-14 16:33:23 +08:00
|
|
|
using osu.Game.Scoring;
|
2020-10-21 18:05:20 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Online.Spectator
|
|
|
|
{
|
|
|
|
[Serializable]
|
2021-01-26 15:39:35 +08:00
|
|
|
[MessagePackObject]
|
2020-10-21 18:05:20 +08:00
|
|
|
public class FrameDataBundle
|
|
|
|
{
|
2021-01-26 15:39:35 +08:00
|
|
|
[Key(0)]
|
2020-12-14 16:33:23 +08:00
|
|
|
public FrameHeader Header { get; set; }
|
|
|
|
|
2021-01-26 15:39:35 +08:00
|
|
|
[Key(1)]
|
2022-01-28 21:06:34 +08:00
|
|
|
public IList<LegacyReplayFrame> Frames { get; set; }
|
2020-10-21 18:05:20 +08:00
|
|
|
|
2023-05-19 15:25:52 +08:00
|
|
|
public FrameDataBundle(ScoreInfo score, ScoreProcessor scoreProcessor, IList<LegacyReplayFrame> frames)
|
2020-10-21 18:05:20 +08:00
|
|
|
{
|
|
|
|
Frames = frames;
|
2023-05-29 19:00:42 +08:00
|
|
|
Header = new FrameHeader(score, scoreProcessor.GetScoreProcessorStatistics());
|
2020-10-21 18:05:20 +08:00
|
|
|
}
|
2020-12-14 17:41:24 +08:00
|
|
|
|
|
|
|
[JsonConstructor]
|
2022-01-28 21:06:34 +08:00
|
|
|
public FrameDataBundle(FrameHeader header, IList<LegacyReplayFrame> frames)
|
2020-12-14 17:41:24 +08:00
|
|
|
{
|
|
|
|
Header = header;
|
|
|
|
Frames = frames;
|
|
|
|
}
|
2020-10-21 18:05:20 +08:00
|
|
|
}
|
|
|
|
}
|