using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Content.Server.GameTicking.Rules; using Content.Shared.Preferences; using Content.Shared.Roles; using Robust.Server.Player; using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Timing; namespace Content.Server.GameTicking { /// /// The game ticker is responsible for managing the round-by-round system of the game. /// public interface IGameTicker { GameRunLevel RunLevel { get; } /// /// The map loaded by the GameTicker on round start. /// MapId DefaultMap { get; } /// /// The GridId loaded by the GameTicker on round start. /// GridId DefaultGridId { get; } event Action OnRunLevelChanged; event Action OnRuleAdded; void Initialize(); void Update(FrameEventArgs frameEventArgs); void RestartRound(); void StartRound(bool force = false); void EndRound(string roundEndText = ""); void Respawn(IPlayerSession targetPlayer); void MakeObserve(IPlayerSession player); void MakeJoinGame(IPlayerSession player, string? jobId = null); void ToggleReady(IPlayerSession player, bool ready); void ToggleDisallowLateJoin(bool disallowLateJoin); /// proxy to GamePreset (actual handler) bool OnGhostAttempt(Mind.Mind mind, bool canReturnGlobal); EntityCoordinates GetLateJoinSpawnPoint(); EntityCoordinates GetJobSpawnPoint(string jobId); EntityCoordinates GetObserverSpawnPoint(); void EquipStartingGear(IEntity entity, StartingGearPrototype startingGear, HumanoidCharacterProfile? profile); // GameRule system. T AddGameRule() where T : GameRule, new(); bool HasGameRule(string? type); bool HasGameRule(Type? type); void RemoveGameRule(GameRule rule); IEnumerable ActiveGameRules { get; } bool TryGetPreset(string name, [NotNullWhen(true)] out Type? type); void SetStartPreset(Type type, bool force = false); void SetStartPreset(string name, bool force = false); /// true if changed, false otherwise bool PauseStart(bool pause = true); /// true if paused, false otherwise bool TogglePause(); bool DelayStart(TimeSpan time); Dictionary GetAvailablePositions(); } }