Seal/abstract/virtual everything (#6739)
This commit is contained in:
@@ -11,7 +11,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.AI.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public class AddAiCommand : IConsoleCommand
|
||||
public sealed class AddAiCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entities = default!;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Content.Server.AI.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IMobMoverComponent))]
|
||||
[Virtual]
|
||||
public class AiControllerComponent : Component, IMobMoverComponent, IMoverComponent
|
||||
{
|
||||
[DataField("logic")] private float _visionRadius = 8.0f;
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.ViewVariables;
|
||||
namespace Content.Server.AI.Components
|
||||
{
|
||||
[Prototype("aiFaction")]
|
||||
public class AiFactionPrototype : IPrototype
|
||||
public sealed class AiFactionPrototype : IPrototype
|
||||
{
|
||||
// These are immutable so any dynamic changes aren't saved back over.
|
||||
// AiFactionSystem will just read these and then store them.
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.AI.EntitySystems
|
||||
/// Handles NPCs running every tick.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
internal class NPCSystem : EntitySystem
|
||||
internal sealed class NPCSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.AI.EntitySystems
|
||||
{
|
||||
#if DEBUG
|
||||
[UsedImplicitly]
|
||||
public class ServerAiDebugSystem : EntitySystem
|
||||
public sealed class ServerAiDebugSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.AI.LoadBalancer
|
||||
{
|
||||
public class AiActionRequest
|
||||
public sealed class AiActionRequest
|
||||
{
|
||||
public EntityUid EntityUid { get; }
|
||||
public Blackboard? Context { get; }
|
||||
|
||||
@@ -15,7 +15,7 @@ using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.AI.LoadBalancer
|
||||
{
|
||||
public class AiActionRequestJob : Job<UtilityAction>
|
||||
public sealed class AiActionRequestJob : Job<UtilityAction>
|
||||
{
|
||||
#if DEBUG
|
||||
public static event Action<SharedAiDebug.UtilityAiDebugMessage>? FoundAction;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.AI.LoadBalancer
|
||||
/// <summary>
|
||||
/// This will queue up an AI's request for an action and give it one when possible
|
||||
/// </summary>
|
||||
public class AiActionSystem : EntitySystem
|
||||
public sealed class AiActionSystem : EntitySystem
|
||||
{
|
||||
private readonly AiActionJobQueue _aiRequestQueue = new();
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.Operators.Combat.Melee
|
||||
{
|
||||
public class SwingMeleeWeaponOperator : AiOperator
|
||||
public sealed class SwingMeleeWeaponOperator : AiOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Content.Server.AI.Operators.Generic
|
||||
{
|
||||
public class WaitOperator : AiOperator
|
||||
public sealed class WaitOperator : AiOperator
|
||||
{
|
||||
private readonly float _waitTime;
|
||||
private float _accumulatedTime = 0.0f;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.Operators.Inventory
|
||||
{
|
||||
public class DropEntityOperator : AiOperator
|
||||
public sealed class DropEntityOperator : AiOperator
|
||||
{
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _entity;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.Operators.Inventory
|
||||
{
|
||||
public class DropHandItemsOperator : AiOperator
|
||||
public sealed class DropHandItemsOperator : AiOperator
|
||||
{
|
||||
private readonly EntityUid _owner;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
/// <summary>
|
||||
/// A Generic interacter; if you need to check stuff then make your own
|
||||
/// </summary>
|
||||
public class InteractWithEntityOperator : AiOperator
|
||||
public sealed class InteractWithEntityOperator : AiOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.Operators.Inventory
|
||||
{
|
||||
public class PickupEntityOperator : AiOperator
|
||||
public sealed class PickupEntityOperator : AiOperator
|
||||
{
|
||||
// Input variables
|
||||
private readonly EntityUid _owner;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
/// <summary>
|
||||
/// Will find the item in storage, put it in an active hand, then use it
|
||||
/// </summary>
|
||||
public class UseItemInInventoryOperator : AiOperator
|
||||
public sealed class UseItemInInventoryOperator : AiOperator
|
||||
{
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
|
||||
@@ -9,7 +9,7 @@ using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.AI.Operators.Nutrition
|
||||
{
|
||||
public class UseDrinkInInventoryOperator : AiOperator
|
||||
public sealed class UseDrinkInInventoryOperator : AiOperator
|
||||
{
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.AI.Operators.Nutrition
|
||||
{
|
||||
public class UseFoodInInventoryOperator : AiOperator
|
||||
public sealed class UseFoodInInventoryOperator : AiOperator
|
||||
{
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.AI.Operators.Sequences
|
||||
{
|
||||
public class GoPickupEntitySequence : SequenceOperator
|
||||
public sealed class GoPickupEntitySequence : SequenceOperator
|
||||
{
|
||||
public GoPickupEntitySequence(EntityUid owner, EntityUid target)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.AI.Pathfinding.Accessible
|
||||
/// A group of homogenous PathfindingNodes inside a single chunk
|
||||
/// </summary>
|
||||
/// Makes the graph smaller and quicker to traverse
|
||||
public class PathfindingRegion : IEquatable<PathfindingRegion>
|
||||
public sealed class PathfindingRegion : IEquatable<PathfindingRegion>
|
||||
{
|
||||
/// <summary>
|
||||
/// Bottom-left reference node of the region
|
||||
|
||||
@@ -9,7 +9,7 @@ using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.AI.Pathfinding.Pathfinders
|
||||
{
|
||||
public class AStarPathfindingJob : Job<Queue<TileRef>>
|
||||
public sealed class AStarPathfindingJob : Job<Queue<TileRef>>
|
||||
{
|
||||
#if DEBUG
|
||||
public static event Action<SharedAiDebug.AStarRouteDebug>? DebugRoute;
|
||||
|
||||
@@ -11,7 +11,7 @@ using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.AI.Pathfinding.Pathfinders
|
||||
{
|
||||
public class JpsPathfindingJob : Job<Queue<TileRef>>
|
||||
public sealed class JpsPathfindingJob : Job<Queue<TileRef>>
|
||||
{
|
||||
// Some of this is probably fugly due to other structural changes in pathfinding so it could do with optimisation
|
||||
// Realistically it's probably not getting used given it doesn't support tile costs which can be very useful
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Content.Server.AI.Pathfinding.Pathfinders
|
||||
{
|
||||
public class PathfindingComparer : IComparer<ValueTuple<float, PathfindingNode>>
|
||||
public sealed class PathfindingComparer : IComparer<ValueTuple<float, PathfindingNode>>
|
||||
{
|
||||
public int Compare((float, PathfindingNode) x, (float, PathfindingNode) y)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.AI.Pathfinding
|
||||
{
|
||||
public class PathfindingChunkUpdateMessage : EntityEventArgs
|
||||
public sealed class PathfindingChunkUpdateMessage : EntityEventArgs
|
||||
{
|
||||
public PathfindingChunk Chunk { get; }
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Server.AI.Pathfinding
|
||||
}
|
||||
}
|
||||
|
||||
public class PathfindingChunk
|
||||
public sealed class PathfindingChunk
|
||||
{
|
||||
public TimeSpan LastUpdate { get; private set; }
|
||||
public GridId GridId { get; }
|
||||
|
||||
@@ -13,7 +13,7 @@ using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.AI.Pathfinding
|
||||
{
|
||||
public class PathfindingNode
|
||||
public sealed class PathfindingNode
|
||||
{
|
||||
public PathfindingChunk ParentChunk => _parentChunk;
|
||||
private readonly PathfindingChunk _parentChunk;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.AI.Pathfinding
|
||||
/// This system handles pathfinding graph updates as well as dispatches to the pathfinder
|
||||
/// (90% of what it's doing is graph updates so not much point splitting the 2 roles)
|
||||
/// </summary>
|
||||
public class PathfindingSystem : EntitySystem
|
||||
public sealed class PathfindingSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.AI.Pathfinding
|
||||
{
|
||||
#if DEBUG
|
||||
[UsedImplicitly]
|
||||
public class ServerPathfindingDebugSystem : EntitySystem
|
||||
public sealed class ServerPathfindingDebugSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Server.AI.Utility.Actions.Test
|
||||
/// <summary>
|
||||
/// Used for pathfinding debugging
|
||||
/// </summary>
|
||||
public class MoveRightAndLeftTen : UtilityAction
|
||||
public sealed class MoveRightAndLeftTen : UtilityAction
|
||||
{
|
||||
public override bool CanOverride => false;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.ViewVariables;
|
||||
namespace Content.Server.AI.Utility
|
||||
{
|
||||
[Prototype("behaviorSet")]
|
||||
public class BehaviorSetPrototype : IPrototype
|
||||
public sealed class BehaviorSetPrototype : IPrototype
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of the BehaviorSet.
|
||||
|
||||
@@ -4,7 +4,7 @@ using Content.Shared.Inventory;
|
||||
|
||||
namespace Content.Server.AI.Utility.Considerations.Clothing
|
||||
{
|
||||
public class ClothingInSlotCon : Consideration
|
||||
public sealed class ClothingInSlotCon : Consideration
|
||||
{
|
||||
|
||||
public ClothingInSlotCon Slot(string slot, Blackboard context)
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Reflection;
|
||||
|
||||
namespace Content.Server.AI.Utility.Considerations
|
||||
{
|
||||
public class ConsiderationsManager
|
||||
public sealed class ConsiderationsManager
|
||||
{
|
||||
private readonly Dictionary<Type, Consideration> _considerations = new();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using Content.Server.AI.WorldState;
|
||||
|
||||
namespace Content.Server.AI.Utility.Considerations
|
||||
{
|
||||
public class DummyCon : Consideration
|
||||
public sealed class DummyCon : Consideration
|
||||
{
|
||||
protected override float GetScore(Blackboard context) => 1.0f;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.Utility.Considerations.Hands
|
||||
{
|
||||
public class FreeHandCon : Consideration
|
||||
public sealed class FreeHandCon : Consideration
|
||||
{
|
||||
protected override float GetScore(Blackboard context)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.Utility.Considerations.Inventory
|
||||
{
|
||||
public class CanPutTargetInInventoryCon : Consideration
|
||||
public sealed class CanPutTargetInInventoryCon : Consideration
|
||||
{
|
||||
protected override float GetScore(Blackboard context)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.Utility.Considerations.Inventory
|
||||
{
|
||||
public class TargetInOurInventoryCon : Consideration
|
||||
public sealed class TargetInOurInventoryCon : Consideration
|
||||
{
|
||||
protected override float GetScore(Blackboard context)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.AI.Utility.Considerations.Nutrition.Drink
|
||||
{
|
||||
public class ThirstCon : Consideration
|
||||
public sealed class ThirstCon : Consideration
|
||||
{
|
||||
protected override float GetScore(Blackboard context)
|
||||
{
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace Content.Server.AI.Utility
|
||||
npc.AvailableActions.Sort(_comparer);
|
||||
}
|
||||
|
||||
private class NpcActionComparer : Comparer<IAiUtility>
|
||||
private sealed class NpcActionComparer : Comparer<IAiUtility>
|
||||
{
|
||||
public override int Compare(IAiUtility? x, IAiUtility? y)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.AI.WorldState.States.Hands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class AnyFreeHandState : StateData<bool>
|
||||
public sealed class AnyFreeHandState : StateData<bool>
|
||||
{
|
||||
public override string Name => "AnyFreeHand";
|
||||
public override bool GetValue()
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.AI.WorldState.States.Hands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class HandItemsState : StateData<List<EntityUid>>
|
||||
public sealed class HandItemsState : StateData<List<EntityUid>>
|
||||
{
|
||||
public override string Name => "HandItems";
|
||||
public override List<EntityUid> GetValue()
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.AI.WorldState.States.Nutrition
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class ThirstyState : StateData<bool>
|
||||
public sealed class ThirstyState : StateData<bool>
|
||||
{
|
||||
public override string Name => "Thirsty";
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ namespace Content.Server.AI.WorldState.States.Utility
|
||||
/// <summary>
|
||||
/// Used by the utility AI to calc the adjusted scores
|
||||
/// </summary>
|
||||
public class ConsiderationState : StoredStateData<int>
|
||||
public sealed class ConsiderationState : StoredStateData<int>
|
||||
{
|
||||
public override string Name => "Consideration";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.AI.WorldState.States.Utility
|
||||
/// Used for the utility AI; sets the threshold score we need to beat
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class LastUtilityScoreState : StateData<float>
|
||||
public sealed class LastUtilityScoreState : StateData<float>
|
||||
{
|
||||
public override string Name => "LastBonus";
|
||||
private float _value = 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user