using Content.Shared.Roles;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Replays;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Markdown.Mapping;
using Robust.Shared.Serialization.Markdown.Value;
using Robust.Shared.Timing;
using Robust.Shared.Audio;
namespace Content.Shared.GameTicking
{
public abstract class SharedGameTicker : EntitySystem
{
[Dependency] private readonly IReplayRecordingManager _replay = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
///
/// A list storing the start times of all game rules that have been started this round.
/// Game rules can be started and stopped at any time, including midround.
///
public abstract IReadOnlyList<(TimeSpan, string)> AllPreviousGameRules { get; }
// See ideally these would be pulled from the job definition or something.
// But this is easier, and at least it isn't hardcoded.
//TODO: Move these, they really belong in StationJobsSystem or a cvar.
public static readonly ProtoId FallbackOverflowJob = "Passenger";
public const string FallbackOverflowJobName = "job-name-passenger";
// TODO network.
// Probably most useful for replays, round end info, and probably things like lobby menus.
[ViewVariables]
public int RoundId { get; protected set; }
[ViewVariables] public TimeSpan RoundStartTimeSpan { get; protected set; }
public override void Initialize()
{
base.Initialize();
_replay.RecordingStarted += OnRecordingStart;
}
public override void Shutdown()
{
_replay.RecordingStarted -= OnRecordingStart;
}
private void OnRecordingStart(MappingDataNode metadata, List