Seal/abstract/virtual everything (#6739)
This commit is contained in:
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
class DelayStartCommand : IConsoleCommand
|
||||
sealed class DelayStartCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "delaystart";
|
||||
public string Description => "Delays the round start.";
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
class EndRoundCommand : IConsoleCommand
|
||||
sealed class EndRoundCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "endround";
|
||||
public string Description => "Ends the round and moves the server to PostRound.";
|
||||
|
||||
@@ -11,7 +11,7 @@ using Robust.Shared.Localization;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
class ForceMapCommand : IConsoleCommand
|
||||
sealed class ForceMapCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "forcemap";
|
||||
public string Description => "forcemap-command-description";
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
class ForcePresetCommand : IConsoleCommand
|
||||
sealed class ForcePresetCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "forcepreset";
|
||||
public string Description => "Forces a specific game preset to start for the current lobby.";
|
||||
|
||||
@@ -12,7 +12,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
public class GoLobbyCommand : IConsoleCommand
|
||||
public sealed class GoLobbyCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "golobby";
|
||||
public string Description => "Enables the lobby and restarts the round.";
|
||||
|
||||
@@ -15,7 +15,7 @@ using Robust.Shared.Prototypes;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AnyCommand]
|
||||
class JoinGameCommand : IConsoleCommand
|
||||
sealed class JoinGameCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ using Robust.Shared.Utility;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server | AdminFlags.Mapping)]
|
||||
class MappingCommand : IConsoleCommand
|
||||
sealed class MappingCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entities = default!;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AnyCommand]
|
||||
class ObserveCommand : IConsoleCommand
|
||||
sealed class ObserveCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "observe";
|
||||
public string Description => "";
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.Network;
|
||||
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
class RespawnCommand : IConsoleCommand
|
||||
sealed class RespawnCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "respawn";
|
||||
public string Description => "Respawns a player, kicking them back to the lobby.";
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.GameObjects;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
public class RestartRoundCommand : IConsoleCommand
|
||||
public sealed class RestartRoundCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "restartround";
|
||||
public string Description => "Ends the current round and starts the countdown for the next lobby.";
|
||||
@@ -29,7 +29,7 @@ namespace Content.Server.GameTicking.Commands
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
public class RestartRoundNowCommand : IConsoleCommand
|
||||
public sealed class RestartRoundNowCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "restartroundnow";
|
||||
public string Description => "Moves the server from PostRound to a new PreRoundLobby.";
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
class SetGamePresetCommand : IConsoleCommand
|
||||
sealed class SetGamePresetCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "setgamepreset";
|
||||
public string Description => "";
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
class StartRoundCommand : IConsoleCommand
|
||||
sealed class StartRoundCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "startround";
|
||||
public string Description => "Ends PreRoundLobby state and starts the round.";
|
||||
|
||||
@@ -9,7 +9,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
class ToggleDisallowLateJoinCommand : IConsoleCommand
|
||||
sealed class ToggleDisallowLateJoinCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "toggledisallowlatejoin";
|
||||
public string Description => "Allows or disallows latejoining during mid-game.";
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.GameTicking.Commands
|
||||
{
|
||||
[AnyCommand]
|
||||
class ToggleReadyCommand : IConsoleCommand
|
||||
sealed class ToggleReadyCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "toggleready";
|
||||
public string Description => "";
|
||||
|
||||
@@ -5,6 +5,6 @@ namespace Content.Server.GameTicking.Events;
|
||||
/// <summary>
|
||||
/// Raised at the start of <see cref="GameTicker.StartRound"/>, after round id has been incremented
|
||||
/// </summary>
|
||||
public class RoundStartingEvent : EntityEventArgs
|
||||
public sealed class RoundStartingEvent : EntityEventArgs
|
||||
{
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
[ViewVariables]
|
||||
public bool LobbyEnabled { get; private set; } = false;
|
||||
|
||||
@@ -12,7 +12,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
public const float PresetFailedCooldownIncrease = 30f;
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace Content.Server.GameTicking
|
||||
}
|
||||
}
|
||||
|
||||
public class GhostAttemptHandleEvent : HandledEntityEventArgs
|
||||
public sealed class GhostAttemptHandleEvent : HandledEntityEventArgs
|
||||
{
|
||||
public Mind.Mind Mind { get; }
|
||||
public bool CanReturnGlobal { get; }
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
// No duplicates.
|
||||
[ViewVariables] private readonly HashSet<GameRulePrototype> _addedGameRules = new();
|
||||
|
||||
@@ -17,7 +17,7 @@ using Robust.Shared.ViewVariables;
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
// This code is responsible for the assigning & picking of jobs.
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
[ViewVariables]
|
||||
private readonly List<ManifestEntry> _manifest = new();
|
||||
|
||||
@@ -11,7 +11,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<IPlayerSession, LobbyPlayerStatus> _playersInLobby = new();
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
private const string LobbyMusicCollection = "LobbyMusic";
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ using Robust.Shared.Utility;
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
private static readonly Counter RoundNumberMetric = Metrics.CreateCounter(
|
||||
"ss14_round_number",
|
||||
@@ -572,7 +572,7 @@ namespace Content.Server.GameTicking
|
||||
PostRound = 2
|
||||
}
|
||||
|
||||
public class GameRunLevelChangedEvent
|
||||
public sealed class GameRunLevelChangedEvent
|
||||
{
|
||||
public GameRunLevel Old { get; }
|
||||
public GameRunLevel New { get; }
|
||||
@@ -589,7 +589,7 @@ namespace Content.Server.GameTicking
|
||||
/// Contains a list of game map prototypes to load; modify it if you want to load different maps,
|
||||
/// for example as part of a game rule.
|
||||
/// </summary>
|
||||
public class LoadingMapsEvent : EntityEventArgs
|
||||
public sealed class LoadingMapsEvent : EntityEventArgs
|
||||
{
|
||||
public List<GameMapPrototype> Maps;
|
||||
|
||||
@@ -603,7 +603,7 @@ namespace Content.Server.GameTicking
|
||||
/// Event raised to refresh the late join status.
|
||||
/// If you want to disallow late joins, listen to this and call Disallow.
|
||||
/// </summary>
|
||||
public class RefreshLateJoinAllowedEvent
|
||||
public sealed class RefreshLateJoinAllowedEvent
|
||||
{
|
||||
public bool DisallowLateJoin { get; private set; } = false;
|
||||
|
||||
@@ -617,7 +617,7 @@ namespace Content.Server.GameTicking
|
||||
/// Attempt event raised on round start.
|
||||
/// This can be listened to by GameRule systems to cancel round start if some condition is not met, like player count.
|
||||
/// </summary>
|
||||
public class RoundStartAttemptEvent : CancellableEntityEventArgs
|
||||
public sealed class RoundStartAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public IPlayerSession[] Players { get; }
|
||||
public bool Forced { get; }
|
||||
@@ -634,7 +634,7 @@ namespace Content.Server.GameTicking
|
||||
/// You can use this to spawn people off-station, like in the case of nuke ops or wizard.
|
||||
/// Remove the players you spawned from the PlayerPool and call <see cref="GameTicker.PlayerJoinGame"/> on them.
|
||||
/// </summary>
|
||||
public class RulePlayerSpawningEvent
|
||||
public sealed class RulePlayerSpawningEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Pool of players to be spawned.
|
||||
@@ -657,7 +657,7 @@ namespace Content.Server.GameTicking
|
||||
/// Event raised after players were assigned jobs by the GameTicker.
|
||||
/// You can give on-station people special roles by listening to this event.
|
||||
/// </summary>
|
||||
public class RulePlayerJobsAssignedEvent
|
||||
public sealed class RulePlayerJobsAssignedEvent
|
||||
{
|
||||
public IPlayerSession[] Players { get; }
|
||||
public IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> Profiles { get; }
|
||||
@@ -674,7 +674,7 @@ namespace Content.Server.GameTicking
|
||||
/// <summary>
|
||||
/// Event raised to allow subscribers to add text to the round end summary screen.
|
||||
/// </summary>
|
||||
public class RoundEndTextAppendEvent
|
||||
public sealed class RoundEndTextAppendEvent
|
||||
{
|
||||
private bool _doNewLine;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
private const string ObserverPrototypeName = "MobObserver";
|
||||
|
||||
@@ -366,7 +366,7 @@ namespace Content.Server.GameTicking
|
||||
/// You can use this event to spawn a player off-station on late-join but also at round start.
|
||||
/// When this event is handled, the GameTicker will not perform its own player-spawning logic.
|
||||
/// </summary>
|
||||
public class PlayerBeforeSpawnEvent : HandledEntityEventArgs
|
||||
public sealed class PlayerBeforeSpawnEvent : HandledEntityEventArgs
|
||||
{
|
||||
public IPlayerSession Player { get; }
|
||||
public HumanoidCharacterProfile Profile { get; }
|
||||
@@ -389,7 +389,7 @@ namespace Content.Server.GameTicking
|
||||
/// You can use this to handle people late-joining, or to handle people being spawned at round start.
|
||||
/// Can be used to give random players a role, modify their equipment, etc.
|
||||
/// </summary>
|
||||
public class PlayerSpawnCompleteEvent : EntityEventArgs
|
||||
public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid Mob { get; }
|
||||
public IPlayerSession Player { get; }
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for thread safety, given <see cref="IStatusHost.OnStatusRequest"/> is called from another thread.
|
||||
|
||||
@@ -8,7 +8,7 @@ using Timer = Robust.Shared.Timing.Timer;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker
|
||||
public sealed partial class GameTicker
|
||||
{
|
||||
private static readonly TimeSpan UpdateRestartDelay = TimeSpan.FromSeconds(20);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
public partial class GameTicker : SharedGameTicker
|
||||
public sealed partial class GameTicker : SharedGameTicker
|
||||
{
|
||||
[ViewVariables] private bool _initialized;
|
||||
[ViewVariables] private bool _postInitialized;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.GameTicking.Presets
|
||||
/// A round-start setup preset, such as which antagonists to spawn.
|
||||
/// </summary>
|
||||
[Prototype("gamePreset")]
|
||||
public class GamePresetPrototype : IPrototype
|
||||
public sealed class GamePresetPrototype : IPrototype
|
||||
{
|
||||
[DataField("id", required:true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.Manager.Attributes;
|
||||
namespace Content.Server.GameTicking.Rules;
|
||||
|
||||
[Prototype("gameRule")]
|
||||
public class GameRulePrototype : IPrototype
|
||||
public sealed class GameRulePrototype : IPrototype
|
||||
{
|
||||
[DataField("id", required:true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
@@ -9,7 +9,7 @@ using Timer = Robust.Shared.Timing.Timer;
|
||||
|
||||
namespace Content.Server.GameTicking.Rules;
|
||||
|
||||
public class InactivityTimeRestartRuleSystem : GameRuleSystem
|
||||
public sealed class InactivityTimeRestartRuleSystem : GameRuleSystem
|
||||
{
|
||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
|
||||
@@ -3,7 +3,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.GameTicking.Rules;
|
||||
|
||||
public class SandboxRuleSystem : GameRuleSystem
|
||||
public sealed class SandboxRuleSystem : GameRuleSystem
|
||||
{
|
||||
[Dependency] private readonly ISandboxManager _sandbox = default!;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.GameTicking.Rules;
|
||||
|
||||
public class TraitorDeathMatchRuleSystem : GameRuleSystem
|
||||
public sealed class TraitorDeathMatchRuleSystem : GameRuleSystem
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
|
||||
@@ -27,7 +27,7 @@ using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.GameTicking.Rules;
|
||||
|
||||
public class TraitorRuleSystem : GameRuleSystem
|
||||
public sealed class TraitorRuleSystem : GameRuleSystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
@@ -41,7 +41,7 @@ public class TraitorRuleSystem : GameRuleSystem
|
||||
private readonly List<TraitorRole> _traitors = new ();
|
||||
|
||||
private const string TraitorPrototypeID = "Traitor";
|
||||
|
||||
|
||||
public int TotalTraitors => _traitors.Count;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -188,7 +188,7 @@ public class TraitorRuleSystem : GameRuleSystem
|
||||
if (traitor.Mind.TryAddObjective(objective))
|
||||
difficulty += objective.Difficulty;
|
||||
}
|
||||
|
||||
|
||||
//give traitors their codewords to keep in their character info menu
|
||||
traitor.Mind.Briefing = Loc.GetString("traitor-role-codewords", ("codewords", string.Join(", ",codewords)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user