Seal/abstract/virtual everything (#6739)

This commit is contained in:
mirrorcult
2022-02-16 00:23:23 -07:00
committed by GitHub
parent 4dfcacb86a
commit ec4d4688c7
1771 changed files with 2216 additions and 2164 deletions

View File

@@ -11,7 +11,7 @@ namespace Content.Shared.Actions
/// <summary>
/// Provides access to all configured actions by action type.
/// </summary>
public class ActionManager
public sealed class ActionManager
{
[Dependency]
private readonly IPrototypeManager _prototypeManager = default!;

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Actions.Behaviors
void DoInstantAction(InstantActionEventArgs args);
}
public class InstantActionEventArgs : ActionEventArgs
public sealed class InstantActionEventArgs : ActionEventArgs
{
public InstantActionEventArgs(EntityUid performer, ActionType actionType) : base(performer, actionType)
{

View File

@@ -14,7 +14,7 @@ namespace Content.Shared.Actions.Behaviors
void DoTargetEntityAction(TargetEntityActionEventArgs args);
}
public class TargetEntityActionEventArgs : ActionEventArgs
public sealed class TargetEntityActionEventArgs : ActionEventArgs
{
/// <summary>
/// Entity being targeted

View File

@@ -15,7 +15,7 @@ namespace Content.Shared.Actions.Behaviors
void DoTargetEntityAction(TargetEntityItemActionEventArgs args);
}
public class TargetEntityItemActionEventArgs : ItemActionEventArgs
public sealed class TargetEntityItemActionEventArgs : ItemActionEventArgs
{
/// <summary>
/// Entity being targeted

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Actions.Behaviors
void DoTargetPointAction(TargetPointActionEventArgs args);
}
public class TargetPointActionEventArgs : ActionEventArgs
public sealed class TargetPointActionEventArgs : ActionEventArgs
{
/// <summary>
/// Local coordinates of the targeted position.

View File

@@ -17,7 +17,7 @@ namespace Content.Shared.Actions.Behaviors
void DoTargetPointAction(TargetPointItemActionEventArgs args);
}
public class TargetPointItemActionEventArgs : ItemActionEventArgs
public sealed class TargetPointItemActionEventArgs : ItemActionEventArgs
{
/// <summary>
/// Local coordinates of the targeted position.

View File

@@ -22,7 +22,7 @@ namespace Content.Shared.Actions.Behaviors
bool DoToggleAction(ToggleActionEventArgs args);
}
public class ToggleActionEventArgs : ActionEventArgs
public sealed class ToggleActionEventArgs : ActionEventArgs
{
/// <summary>
/// True if the toggle is attempting to be toggled on, false if attempting to toggle off

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Actions.Behaviors.Item
void DoInstantAction(InstantItemActionEventArgs args);
}
public class InstantItemActionEventArgs : ItemActionEventArgs
public sealed class InstantItemActionEventArgs : ItemActionEventArgs
{
public InstantItemActionEventArgs(EntityUid performer, EntityUid item, ItemActionType actionType) :
base(performer, item, actionType)

View File

@@ -22,7 +22,7 @@ namespace Content.Shared.Actions.Behaviors.Item
bool DoToggleAction(ToggleItemActionEventArgs args);
}
public class ToggleItemActionEventArgs : ItemActionEventArgs
public sealed class ToggleItemActionEventArgs : ItemActionEventArgs
{
/// <summary>
/// True if the toggle was toggled on, false if it was toggled off

View File

@@ -24,7 +24,7 @@ namespace Content.Shared.Actions.Components
/// Currently only maintained server side and not synced to client, as are all the equip/unequip events.
/// </summary>
[RegisterComponent]
public class ItemActionsComponent : Component
public sealed class ItemActionsComponent : Component
{
/// <summary>
/// Configuration for the item actions initially provided by this item. Actions defined here
@@ -182,7 +182,7 @@ namespace Content.Shared.Actions.Components
/// Configuration for an item action provided by an item.
/// </summary>
[DataDefinition]
public class ItemActionConfig : ISerializationHooks
public sealed class ItemActionConfig : ISerializationHooks
{
[DataField("actionType", required: true)]
public ItemActionType ActionType { get; private set; } = ItemActionType.Error;

View File

@@ -383,7 +383,7 @@ namespace Content.Shared.Actions.Components
}
[Serializable, NetSerializable]
public class ActionComponentState : ComponentState
public sealed class ActionComponentState : ComponentState
{
public Dictionary<ActionType, ActionState> Actions;
public Dictionary<EntityUid, Dictionary<ItemActionType, ActionState>> ItemActions;
@@ -488,7 +488,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to run the instant action logic.
/// </summary>
[Serializable, NetSerializable]
public class PerformInstantActionMessage : PerformActionMessage
public sealed class PerformInstantActionMessage : PerformActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.Instant;
@@ -501,7 +501,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to run the instant action logic.
/// </summary>
[Serializable, NetSerializable]
public class PerformInstantItemActionMessage : PerformItemActionMessage
public sealed class PerformInstantItemActionMessage : PerformItemActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.Instant;
@@ -535,7 +535,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to toggle on the indicated action.
/// </summary>
[Serializable, NetSerializable]
public class PerformToggleOnActionMessage : PerformActionMessage, IToggleActionMessage
public sealed class PerformToggleOnActionMessage : PerformActionMessage, IToggleActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.Toggle;
public bool ToggleOn => true;
@@ -546,7 +546,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to toggle off the indicated action.
/// </summary>
[Serializable, NetSerializable]
public class PerformToggleOffActionMessage : PerformActionMessage, IToggleActionMessage
public sealed class PerformToggleOffActionMessage : PerformActionMessage, IToggleActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.Toggle;
public bool ToggleOn => false;
@@ -557,7 +557,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to toggle on the indicated action.
/// </summary>
[Serializable, NetSerializable]
public class PerformToggleOnItemActionMessage : PerformItemActionMessage, IToggleActionMessage
public sealed class PerformToggleOnItemActionMessage : PerformItemActionMessage, IToggleActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.Toggle;
public bool ToggleOn => true;
@@ -568,7 +568,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to toggle off the indicated action.
/// </summary>
[Serializable, NetSerializable]
public class PerformToggleOffItemActionMessage : PerformItemActionMessage, IToggleActionMessage
public sealed class PerformToggleOffItemActionMessage : PerformItemActionMessage, IToggleActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.Toggle;
public bool ToggleOn => false;
@@ -579,7 +579,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to target the provided point with a particular action.
/// </summary>
[Serializable, NetSerializable]
public class PerformTargetPointActionMessage : PerformActionMessage, ITargetPointActionMessage
public sealed class PerformTargetPointActionMessage : PerformActionMessage, ITargetPointActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.TargetPoint;
private readonly EntityCoordinates _target;
@@ -595,7 +595,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to target the provided point with a particular action.
/// </summary>
[Serializable, NetSerializable]
public class PerformTargetPointItemActionMessage : PerformItemActionMessage, ITargetPointActionMessage
public sealed class PerformTargetPointItemActionMessage : PerformItemActionMessage, ITargetPointActionMessage
{
private readonly EntityCoordinates _target;
public EntityCoordinates Target => _target;
@@ -611,7 +611,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to target the provided entity with a particular action.
/// </summary>
[Serializable, NetSerializable]
public class PerformTargetEntityActionMessage : PerformActionMessage, ITargetEntityActionMessage
public sealed class PerformTargetEntityActionMessage : PerformActionMessage, ITargetEntityActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.TargetEntity;
private readonly EntityUid _target;
@@ -627,7 +627,7 @@ namespace Content.Shared.Actions.Components
/// A message that tells server we want to target the provided entity with a particular action.
/// </summary>
[Serializable, NetSerializable]
public class PerformTargetEntityItemActionMessage : PerformItemActionMessage, ITargetEntityActionMessage
public sealed class PerformTargetEntityItemActionMessage : PerformItemActionMessage, ITargetEntityActionMessage
{
public override BehaviorType BehaviorType => BehaviorType.TargetEntity;
private readonly EntityUid _target;

View File

@@ -59,7 +59,7 @@ namespace Content.Shared.Actions
void DoTargetEntityAction(EntityUid player, EntityUid target);
}
public class ActionAttempt : IActionAttempt
public sealed class ActionAttempt : IActionAttempt
{
private readonly ActionPrototype _action;
@@ -139,7 +139,7 @@ namespace Content.Shared.Actions
}
}
public class ItemActionAttempt : IActionAttempt
public sealed class ItemActionAttempt : IActionAttempt
{
private readonly ItemActionPrototype _action;
private readonly EntityUid _item;

View File

@@ -14,7 +14,7 @@ namespace Content.Shared.Actions.Prototypes
/// </summary>
[Prototype("action")]
[DataDefinition]
public class ActionPrototype : BaseActionPrototype, ISerializationHooks
public sealed class ActionPrototype : BaseActionPrototype, ISerializationHooks
{
/// <summary>
/// Type of action, no 2 action prototypes should have the same one.

View File

@@ -14,7 +14,7 @@ namespace Content.Shared.Actions.Prototypes
/// </summary>
[Prototype("itemAction")]
[DataDefinition]
public class ItemActionPrototype : BaseActionPrototype, ISerializationHooks
public sealed class ItemActionPrototype : BaseActionPrototype, ISerializationHooks
{
/// <summary>
/// Type of item action, no 2 itemAction prototypes should have the same one.

View File

@@ -9,7 +9,7 @@ namespace Content.Shared.Actions
/// <summary>
/// Evicts action states with expired cooldowns.
/// </summary>
public class SharedActionSystem : EntitySystem
public sealed class SharedActionSystem : EntitySystem
{
private const float CooldownCheckIntervalSeconds = 10;
private float _timeSinceCooldownCheck;