Refactor serialization copying to use source generators (#19412)

This commit is contained in:
DrSmugleaf
2023-08-22 18:14:33 -07:00
committed by GitHub
parent 08b43990ab
commit a88e747a0b
1737 changed files with 2532 additions and 2521 deletions

View File

@@ -11,7 +11,7 @@ namespace Content.Shared.Doors.Components;
/// </summary>
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedAirlockSystem), Friend = AccessPermissions.ReadWriteExecute, Other = AccessPermissions.Read)]
public sealed class AirlockComponent : Component
public sealed partial class AirlockComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("safety")]
@@ -27,7 +27,7 @@ public sealed class AirlockComponent : Component
/// so this default is closer to 6 effectively on e.g. jaws (9 seconds when applied to other default.)
/// </summary>
[DataField("poweredPryModifier")]
public readonly float PoweredPryModifier = 9f;
public float PoweredPryModifier = 9f;
/// <summary>
/// Whether the maintenance panel should be visible even if the airlock is opened.

View File

@@ -9,7 +9,7 @@ namespace Content.Shared.Doors.Components;
/// </summary>
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedDoorBoltSystem))]
public sealed class DoorBoltComponent : Component
public sealed partial class DoorBoltComponent : Component
{
/// <summary>
/// Sound to play when the bolts on the airlock go up.

View File

@@ -15,7 +15,7 @@ namespace Content.Shared.Doors.Components;
[NetworkedComponent]
[RegisterComponent]
public sealed class DoorComponent : Component
public sealed partial class DoorComponent : Component
{
/// <summary>
/// The current state of the door -- whether it is open, closed, opening, or closing.
@@ -36,34 +36,34 @@ public sealed class DoorComponent : Component
/// Closing time until impassable. Total time is this plus <see cref="CloseTimeTwo"/>.
/// </summary>
[DataField("closeTimeOne")]
public readonly TimeSpan CloseTimeOne = TimeSpan.FromSeconds(0.4f);
public TimeSpan CloseTimeOne = TimeSpan.FromSeconds(0.4f);
/// <summary>
/// Closing time until fully closed. Total time is this plus <see cref="CloseTimeOne"/>.
/// </summary>
[DataField("closeTimeTwo")]
public readonly TimeSpan CloseTimeTwo = TimeSpan.FromSeconds(0.2f);
public TimeSpan CloseTimeTwo = TimeSpan.FromSeconds(0.2f);
/// <summary>
/// Opening time until passable. Total time is this plus <see cref="OpenTimeTwo"/>.
/// </summary>
[DataField("openTimeOne")]
public readonly TimeSpan OpenTimeOne = TimeSpan.FromSeconds(0.4f);
public TimeSpan OpenTimeOne = TimeSpan.FromSeconds(0.4f);
/// <summary>
/// Opening time until fully open. Total time is this plus <see cref="OpenTimeOne"/>.
/// </summary>
[DataField("openTimeTwo")]
public readonly TimeSpan OpenTimeTwo = TimeSpan.FromSeconds(0.2f);
public TimeSpan OpenTimeTwo = TimeSpan.FromSeconds(0.2f);
/// <summary>
/// Interval between deny sounds & visuals;
/// </summary>
[DataField("denyDuration")]
public readonly TimeSpan DenyDuration = TimeSpan.FromSeconds(0.45f);
public TimeSpan DenyDuration = TimeSpan.FromSeconds(0.45f);
[DataField("emagDuration")]
public readonly TimeSpan EmagDuration = TimeSpan.FromSeconds(0.8f);
public TimeSpan EmagDuration = TimeSpan.FromSeconds(0.8f);
/// <summary>
/// When the door is active, this is the time when the state will next update.
@@ -116,7 +116,7 @@ public sealed class DoorComponent : Component
/// again. Total stun time is actually given by this plus <see cref="OpenTimeOne"/>.
/// </summary>
[DataField("doorStunTime")]
public readonly TimeSpan DoorStunTime = TimeSpan.FromSeconds(2f);
public TimeSpan DoorStunTime = TimeSpan.FromSeconds(2f);
[DataField("crushDamage")]
public DamageSpecifier? CrushDamage;
@@ -126,14 +126,14 @@ public sealed class DoorComponent : Component
/// stun, not whether it can close despite entities being in the way.
/// </summary>
[DataField("canCrush")]
public readonly bool CanCrush = true;
public bool CanCrush = true;
/// <summary>
/// Whether to check for colliding entities before closing. This may be overridden by other system by subscribing to
/// <see cref="BeforeDoorClosedEvent"/>. For example, hacked airlocks will set this to false.
/// </summary>
[DataField("performCollisionCheck")]
public readonly bool PerformCollisionCheck = true;
public bool PerformCollisionCheck = true;
/// <summary>
/// List of EntityUids of entities we're currently crushing. Cleared in OnPartialOpen().

View File

@@ -8,7 +8,7 @@ namespace Content.Shared.Doors.Components
/// retaining pressure..
/// </summary>
[RegisterComponent]
public sealed class FirelockComponent : Component
public sealed partial class FirelockComponent : Component
{
/// <summary>
/// Pry time modifier to be used when the firelock is currently closed due to fire or pressure.