mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 22:22:54 +08:00
Annotate nullables
This commit is contained in:
parent
9d07749959
commit
6eff8d513e
@ -1,12 +1,13 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -45,36 +46,37 @@ namespace osu.Game.Online.Spectator
|
|||||||
|
|
||||||
private readonly Dictionary<int, SpectatorState> playingUserStates = new Dictionary<int, SpectatorState>();
|
private readonly Dictionary<int, SpectatorState> playingUserStates = new Dictionary<int, SpectatorState>();
|
||||||
|
|
||||||
[CanBeNull]
|
private IBeatmap? currentBeatmap;
|
||||||
private IBeatmap currentBeatmap;
|
|
||||||
|
|
||||||
[CanBeNull]
|
private Score? currentScore;
|
||||||
private Score currentScore;
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IBindable<RulesetInfo> currentRuleset { get; set; }
|
private IBindable<RulesetInfo> currentRuleset { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IBindable<IReadOnlyList<Mod>> currentMods { get; set; }
|
private IBindable<IReadOnlyList<Mod>> currentMods { get; set; } = null!;
|
||||||
|
|
||||||
private readonly SpectatorState currentState = new SpectatorState();
|
private readonly SpectatorState currentState = new SpectatorState();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the local user is playing.
|
||||||
|
/// </summary>
|
||||||
protected bool IsPlaying { get; private set; }
|
protected bool IsPlaying { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called whenever new frames arrive from the server.
|
/// Called whenever new frames arrive from the server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<int, FrameDataBundle> OnNewFrames;
|
public event Action<int, FrameDataBundle>? OnNewFrames;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called whenever a user starts a play session, or immediately if the user is being watched and currently in a play session.
|
/// Called whenever a user starts a play session, or immediately if the user is being watched and currently in a play session.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<int, SpectatorState> OnUserBeganPlaying;
|
public event Action<int, SpectatorState>? OnUserBeganPlaying;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called whenever a user finishes a play session.
|
/// Called whenever a user finishes a play session.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<int, SpectatorState> OnUserFinishedPlaying;
|
public event Action<int, SpectatorState>? OnUserFinishedPlaying;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
@ -215,7 +217,7 @@ namespace osu.Game.Online.Spectator
|
|||||||
|
|
||||||
private double lastSendTime;
|
private double lastSendTime;
|
||||||
|
|
||||||
private Task lastSend;
|
private Task? lastSend;
|
||||||
|
|
||||||
private const int max_pending_frames = 30;
|
private const int max_pending_frames = 30;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user