Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -71,7 +71,7 @@ public sealed class RequestPerformActionEvent : EntityEventArgs
|
||||
/// <remarks>
|
||||
/// To define a new action for some system, you need to create an event that inherits from this class.
|
||||
/// </remarks>
|
||||
public abstract class InstantActionEvent : BaseActionEvent { }
|
||||
public abstract partial class InstantActionEvent : BaseActionEvent { }
|
||||
|
||||
/// <summary>
|
||||
/// This is the type of event that gets raised when an <see cref="EntityTargetAction"/> is performed. The <see
|
||||
@@ -81,7 +81,7 @@ public abstract class InstantActionEvent : BaseActionEvent { }
|
||||
/// <remarks>
|
||||
/// To define a new action for some system, you need to create an event that inherits from this class.
|
||||
/// </remarks>
|
||||
public abstract class EntityTargetActionEvent : BaseActionEvent
|
||||
public abstract partial class EntityTargetActionEvent : BaseActionEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// The entity that the user targeted.
|
||||
@@ -97,7 +97,7 @@ public abstract class EntityTargetActionEvent : BaseActionEvent
|
||||
/// <remarks>
|
||||
/// To define a new action for some system, you need to create an event that inherits from this class.
|
||||
/// </remarks>
|
||||
public abstract class WorldTargetActionEvent : BaseActionEvent
|
||||
public abstract partial class WorldTargetActionEvent : BaseActionEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// The coordinates of the location that the user targeted.
|
||||
@@ -110,7 +110,7 @@ public abstract class WorldTargetActionEvent : BaseActionEvent
|
||||
/// system.
|
||||
/// </summary>
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
public abstract class BaseActionEvent : HandledEntityEventArgs
|
||||
public abstract partial class BaseActionEvent : HandledEntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The user performing the action.
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace Content.Shared.Actions.ActionTypes;
|
||||
// anymore.
|
||||
|
||||
[Prototype("worldTargetAction")]
|
||||
public sealed class WorldTargetActionPrototype : WorldTargetAction, IPrototype
|
||||
public sealed partial class WorldTargetActionPrototype : WorldTargetAction, IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
// This is a shitty hack to get around the fact that action-prototypes should not in general be sever-exclusive
|
||||
// prototypes, but some actions may need to use server-exclusive events, and there is no way to specify on a
|
||||
@@ -27,10 +27,10 @@ public sealed class WorldTargetActionPrototype : WorldTargetAction, IPrototype
|
||||
}
|
||||
|
||||
[Prototype("entityTargetAction")]
|
||||
public sealed class EntityTargetActionPrototype : EntityTargetAction, IPrototype
|
||||
public sealed partial class EntityTargetActionPrototype : EntityTargetAction, IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
[DataField("serverEvent", serverOnly: true)]
|
||||
public EntityTargetActionEvent? ServerEvent
|
||||
@@ -41,10 +41,10 @@ public sealed class EntityTargetActionPrototype : EntityTargetAction, IPrototype
|
||||
}
|
||||
|
||||
[Prototype("instantAction")]
|
||||
public sealed class InstantActionPrototype : InstantAction, IPrototype
|
||||
public sealed partial class InstantActionPrototype : InstantAction, IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
[DataField("serverEvent", serverOnly: true)]
|
||||
public InstantActionEvent? ServerEvent
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Shared.Actions.ActionTypes;
|
||||
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
[Serializable, NetSerializable]
|
||||
public abstract class ActionType : IEquatable<ActionType>, IComparable, ICloneable
|
||||
public abstract partial class ActionType : IEquatable<ActionType>, IComparable, ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Icon representing this action in the UI.
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Actions.ActionTypes;
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
[Virtual]
|
||||
public class InstantAction : ActionType
|
||||
public partial class InstantAction : ActionType
|
||||
{
|
||||
/// <summary>
|
||||
/// The local-event to raise when this action is performed.
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Actions.ActionTypes;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public abstract class TargetedAction : ActionType
|
||||
public abstract partial class TargetedAction : ActionType
|
||||
{
|
||||
/// <summary>
|
||||
/// For entity- or map-targeting actions, if this is true the action will remain selected after it is used, so
|
||||
@@ -71,7 +71,7 @@ public abstract class TargetedAction : ActionType
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
[Virtual]
|
||||
public class EntityTargetAction : TargetedAction
|
||||
public partial class EntityTargetAction : TargetedAction
|
||||
{
|
||||
/// <summary>
|
||||
/// The local-event to raise when this action is performed.
|
||||
@@ -119,7 +119,7 @@ public class EntityTargetAction : TargetedAction
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
[Virtual]
|
||||
public class WorldTargetAction : TargetedAction
|
||||
public partial class WorldTargetAction : TargetedAction
|
||||
{
|
||||
/// <summary>
|
||||
/// The local-event to raise when this action is performed.
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Actions;
|
||||
[NetworkedComponent]
|
||||
[RegisterComponent]
|
||||
[Access(typeof(SharedActionsSystem))]
|
||||
public sealed class ActionsComponent : Component
|
||||
public sealed partial class ActionsComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
[Access(typeof(SharedActionsSystem), Other = AccessPermissions.ReadExecute)]
|
||||
|
||||
Reference in New Issue
Block a user