Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -4,4 +4,4 @@ namespace Content.Server.NPC.Components;
|
||||
/// Added to NPCs that are actively being updated.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ActiveNPCComponent : Component {}
|
||||
public sealed partial class ActiveNPCComponent : Component {}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.NPC.Components;
|
||||
/// Can be added to if pettable, see PettableFriendComponent.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(FactionExceptionSystem))]
|
||||
public sealed class FactionExceptionComponent : Component
|
||||
public sealed partial class FactionExceptionComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// List of entities that this NPC will refuse to attack
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Content.Server.NPC.Components;
|
||||
/// Should this entity be considered for collision avoidance
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class NPCAvoidanceComponent : Component
|
||||
public sealed partial class NPCAvoidanceComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("enabled")]
|
||||
public bool Enabled = true;
|
||||
|
||||
@@ -2,7 +2,7 @@ using Content.Shared.NPC;
|
||||
|
||||
namespace Content.Server.NPC.Components
|
||||
{
|
||||
public abstract class NPCComponent : SharedNPCComponent
|
||||
public abstract partial class NPCComponent : SharedNPCComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains all of the world data for a particular NPC in terms of how it sees the world.
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
namespace Content.Server.NPC.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class NPCJukeComponent : Component
|
||||
public sealed partial class NPCJukeComponent : Component
|
||||
{
|
||||
[DataField("jukeType")]
|
||||
public JukeType JukeType = JukeType.Away;
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Content.Server.NPC.Components;
|
||||
/// Added to NPCs whenever they're in melee combat so they can be handled by the dedicated system.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class NPCMeleeCombatComponent : Component
|
||||
public sealed partial class NPCMeleeCombatComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// If the target is moving what is the chance for this NPC to miss.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.NPC.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class NPCPathfindPointComponent : Component
|
||||
public sealed partial class NPCPathfindPointComponent : Component
|
||||
{
|
||||
// /// <summary>
|
||||
// /// Next point for the NPC to head to.
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.NPC.Components;
|
||||
/// Added to an NPC doing ranged combat.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class NPCRangedCombatComponent : Component
|
||||
public sealed partial class NPCRangedCombatComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public EntityUid Target;
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace Content.Server.NPC.Components
|
||||
/// Added when a medibot injects someone
|
||||
/// So they don't get injected again for at least a minute.
|
||||
[RegisterComponent]
|
||||
public sealed class NPCRecentlyInjectedComponent : Component
|
||||
public sealed partial class NPCRecentlyInjectedComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("accumulator")]
|
||||
public float Accumulator = 0f;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.NPC.Components;
|
||||
/// Added to NPCs that are moving.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class NPCSteeringComponent : Component
|
||||
public sealed partial class NPCSteeringComponent : Component
|
||||
{
|
||||
#region Context Steering
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Content.Server.NPC.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[Access(typeof(NpcFactionSystem))]
|
||||
public sealed class NpcFactionMemberComponent : Component
|
||||
public sealed partial class NpcFactionMemberComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Factions this entity is a part of.
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.NPC.Components
|
||||
{
|
||||
[ViewVariables]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("friendly", customTypeSerializer:typeof(PrototypeIdListSerializer<NpcFactionPrototype>))]
|
||||
public List<string> Friendly = new();
|
||||
|
||||
Reference in New Issue
Block a user