Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -2,7 +2,7 @@ using Content.Server.NPC.Components;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Combat;
|
||||
|
||||
public sealed class JukeOperator : HTNOperator, IHtnConditionalShutdown
|
||||
public sealed partial class JukeOperator : HTNOperator, IHtnConditionalShutdown
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
@@ -10,7 +10,7 @@ public sealed class JukeOperator : HTNOperator, IHtnConditionalShutdown
|
||||
public JukeType JukeType = JukeType.AdjacentTile;
|
||||
|
||||
[DataField("shutdownState")]
|
||||
public HTNPlanState ShutdownState { get; } = HTNPlanState.PlanFinished;
|
||||
public HTNPlanState ShutdownState { get; private set; } = HTNPlanState.PlanFinished;
|
||||
|
||||
public override void Startup(NPCBlackboard blackboard)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Combat.Melee;
|
||||
/// <summary>
|
||||
/// Attacks the specified key in melee combat.
|
||||
/// </summary>
|
||||
public sealed class MeleeOperator : HTNOperator, IHtnConditionalShutdown
|
||||
public sealed partial class MeleeOperator : HTNOperator, IHtnConditionalShutdown
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
@@ -18,7 +18,7 @@ public sealed class MeleeOperator : HTNOperator, IHtnConditionalShutdown
|
||||
/// When to shut the task down.
|
||||
/// </summary>
|
||||
[DataField("shutdownState")]
|
||||
public HTNPlanState ShutdownState { get; } = HTNPlanState.TaskFinished;
|
||||
public HTNPlanState ShutdownState { get; private set; } = HTNPlanState.TaskFinished;
|
||||
|
||||
/// <summary>
|
||||
/// Key that contains the target entity.
|
||||
|
||||
@@ -8,12 +8,12 @@ using Robust.Shared.Audio;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Combat.Ranged;
|
||||
|
||||
public sealed class GunOperator : HTNOperator, IHtnConditionalShutdown
|
||||
public sealed partial class GunOperator : HTNOperator, IHtnConditionalShutdown
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
[DataField("shutdownState")]
|
||||
public HTNPlanState ShutdownState { get; } = HTNPlanState.TaskFinished;
|
||||
public HTNPlanState ShutdownState { get; private set; } = HTNPlanState.TaskFinished;
|
||||
|
||||
/// <summary>
|
||||
/// Key that contains the target entity.
|
||||
|
||||
@@ -6,7 +6,7 @@ using Content.Shared.Interaction;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Interactions;
|
||||
|
||||
public sealed class AltInteractOperator : HTNOperator
|
||||
public sealed partial class AltInteractOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Interactions;
|
||||
/// <summary>
|
||||
/// Drops the active hand entity underneath us.
|
||||
/// </summary>
|
||||
public sealed class DropOperator : HTNOperator
|
||||
public sealed partial class DropOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using Content.Server.Hands.Systems;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Interactions;
|
||||
|
||||
public sealed class EquipOperator : HTNOperator
|
||||
public sealed partial class EquipOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Content.Shared.Timing;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Interactions;
|
||||
|
||||
public sealed class InteractWithOperator : HTNOperator
|
||||
public sealed partial class InteractWithOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Interactions;
|
||||
/// <summary>
|
||||
/// Swaps to any free hand.
|
||||
/// </summary>
|
||||
public sealed class SwapToFreeHandOperator : HTNOperator
|
||||
public sealed partial class SwapToFreeHandOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
/// <summary>
|
||||
/// Moves an NPC to the specified target key. Hands the actual steering off to NPCSystem.Steering
|
||||
/// </summary>
|
||||
public sealed class MoveToOperator : HTNOperator, IHtnConditionalShutdown
|
||||
public sealed partial class MoveToOperator : HTNOperator, IHtnConditionalShutdown
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
@@ -23,7 +23,7 @@ public sealed class MoveToOperator : HTNOperator, IHtnConditionalShutdown
|
||||
/// When to shut the task down.
|
||||
/// </summary>
|
||||
[DataField("shutdownState")]
|
||||
public HTNPlanState ShutdownState { get; } = HTNPlanState.TaskFinished;
|
||||
public HTNPlanState ShutdownState { get; private set; } = HTNPlanState.TaskFinished;
|
||||
|
||||
/// <summary>
|
||||
/// Should we assume the MovementTarget is reachable during planning or should we pathfind to it?
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
/// <summary>
|
||||
/// What it sounds like.
|
||||
/// </summary>
|
||||
public sealed class NoOperator : HTNOperator
|
||||
public sealed partial class NoOperator : HTNOperator
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
/// <summary>
|
||||
/// Picks a nearby component that is accessible.
|
||||
/// </summary>
|
||||
public sealed class PickAccessibleComponentOperator : HTNOperator
|
||||
public sealed partial class PickAccessibleComponentOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IComponentFactory _factory = default!;
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
/// <summary>
|
||||
/// Chooses a nearby coordinate and puts it into the resulting key.
|
||||
/// </summary>
|
||||
public sealed class PickAccessibleOperator : HTNOperator
|
||||
public sealed partial class PickAccessibleOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
private PathfindingSystem _pathfinding = default!;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
|
||||
public sealed class PickRandomRotationOperator : HTNOperator
|
||||
public sealed partial class PickRandomRotationOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
|
||||
public sealed class RandomOperator : HTNOperator
|
||||
public sealed partial class RandomOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
@@ -2,7 +2,7 @@ using Content.Shared.Interaction;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
|
||||
public sealed class RotateToTargetOperator : HTNOperator
|
||||
public sealed partial class RotateToTargetOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
private RotateToFaceSystem _rotate = default!;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
/// <summary>
|
||||
/// Just sets a blackboard key to a float
|
||||
/// </summary>
|
||||
public sealed class SetFloatOperator : HTNOperator
|
||||
public sealed partial class SetFloatOperator : HTNOperator
|
||||
{
|
||||
[DataField("targetKey", required: true)] public string TargetKey = string.Empty;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using Content.Server.Chat.Systems;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
|
||||
public sealed class SpeakOperator : HTNOperator
|
||||
public sealed partial class SpeakOperator : HTNOperator
|
||||
{
|
||||
private ChatSystem _chat = default!;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Specific;
|
||||
|
||||
public sealed class MedibotInjectOperator : HTNOperator
|
||||
public sealed partial class MedibotInjectOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
private SharedAudioSystem _audio = default!;
|
||||
|
||||
@@ -11,7 +11,7 @@ using Content.Shared.Emag.Components;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Specific;
|
||||
|
||||
public sealed class PickNearbyInjectableOperator : HTNOperator
|
||||
public sealed partial class PickNearbyInjectableOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
private EntityLookupSystem _lookup = default!;
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Test;
|
||||
|
||||
public sealed class PickPathfindPointOperator : HTNOperator
|
||||
public sealed partial class PickPathfindPointOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
/// <summary>
|
||||
/// Utilises a <see cref="UtilityQueryPrototype"/> to determine the best target and sets it to the Key.
|
||||
/// </summary>
|
||||
public sealed class UtilityOperator : HTNOperator
|
||||
public sealed partial class UtilityOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
||||
/// <summary>
|
||||
/// Waits the specified amount of time. Removes the key when finished.
|
||||
/// </summary>
|
||||
public sealed class WaitOperator : HTNOperator
|
||||
public sealed partial class WaitOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user