Remove field: from DataField attributes (#3932)

This commit is contained in:
DrSmugleaf
2021-05-04 15:37:16 +02:00
committed by GitHub
parent 85f3871536
commit ad3b7fe97d
84 changed files with 228 additions and 242 deletions

View File

@@ -93,14 +93,14 @@ namespace Content.Client.Changelog
[DataField("id")] [DataField("id")]
public int Id { get; private set; } public int Id { get; private set; }
[field: DataField("author")] [DataField("author")]
public string Author { get; } = ""; public string Author { get; } = "";
[DataField("time")] private string _time = default!; [DataField("time")] private string _time = default!;
public DateTime Time { get; private set; } public DateTime Time { get; private set; }
[field: DataField("changes")] [DataField("changes")]
public List<ChangelogChange> Changes { get; } = default!; public List<ChangelogChange> Changes { get; } = default!;
void ISerializationHooks.AfterDeserialization() void ISerializationHooks.AfterDeserialization()

View File

@@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Atmos
[UsedImplicitly] [UsedImplicitly]
public class AtmosPlaqueVisualizer : AppearanceVisualizer public class AtmosPlaqueVisualizer : AppearanceVisualizer
{ {
[field: DataField("layer")] [DataField("layer")]
private int Layer { get; } private int Layer { get; }
public override void InitializeEntity(IEntity entity) public override void InitializeEntity(IEntity entity)

View File

@@ -41,13 +41,13 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
/// <summary> /// <summary>
/// We will smooth with other objects with the same key. /// We will smooth with other objects with the same key.
/// </summary> /// </summary>
[field: DataField("key")] [DataField("key")]
public string? SmoothKey { get; } public string? SmoothKey { get; }
/// <summary> /// <summary>
/// Prepended to the RSI state. /// Prepended to the RSI state.
/// </summary> /// </summary>
[field: DataField("base")] [DataField("base")]
public string StateBase { get; } = string.Empty; public string StateBase { get; } = string.Empty;
/// <summary> /// <summary>

View File

@@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.MachineLinking
[UsedImplicitly] [UsedImplicitly]
public class SignalSwitchVisualizer : AppearanceVisualizer public class SignalSwitchVisualizer : AppearanceVisualizer
{ {
[field: DataField("layer")] [DataField("layer")]
private int Layer { get; } private int Layer { get; }
public override void InitializeEntity(IEntity entity) public override void InitializeEntity(IEntity entity)

View File

@@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Mining
[UsedImplicitly] [UsedImplicitly]
public class AsteroidRockVisualizer : AppearanceVisualizer public class AsteroidRockVisualizer : AppearanceVisualizer
{ {
[field: DataField("layer")] [DataField("layer")]
private int Layer { get; } = 0; private int Layer { get; } = 0;
public override void InitializeEntity(IEntity entity) public override void InitializeEntity(IEntity entity)

View File

@@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Singularity
[UsedImplicitly] [UsedImplicitly]
public class SingularityVisualizer : AppearanceVisualizer public class SingularityVisualizer : AppearanceVisualizer
{ {
[field: DataField("layer")] [DataField("layer")]
private int Layer { get; } = 0; private int Layer { get; } = 0;
public override void InitializeEntity(IEntity entity) public override void InitializeEntity(IEntity entity)

View File

@@ -35,7 +35,7 @@ namespace Content.Server.AI.Utility.AiLogic
/// <summary> /// <summary>
/// The sum of all BehaviorSets gives us what actions the AI can take /// The sum of all BehaviorSets gives us what actions the AI can take
/// </summary> /// </summary>
[field: DataField("behaviorSets")] [DataField("behaviorSets")]
public HashSet<string> BehaviorSets { get; } = new(); public HashSet<string> BehaviorSets { get; } = new();
public List<IAiUtility> AvailableActions { get; set; } = new(); public List<IAiUtility> AvailableActions { get; set; } = new();

View File

@@ -13,7 +13,7 @@ namespace Content.Server.AI.Utility
/// Name of the BehaviorSet. /// Name of the BehaviorSet.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>

View File

@@ -10,10 +10,10 @@ namespace Content.Server.Advertisements
public class AdvertisementsPackPrototype : IPrototype public class AdvertisementsPackPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("advertisements")] [DataField("advertisements")]
public List<string> Advertisements { get; } = new(); public List<string> Advertisements { get; } = new();
} }
} }

View File

@@ -27,38 +27,38 @@ namespace Content.Server.Atmos.Reactions
public class GasReactionPrototype : IPrototype public class GasReactionPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>
/// Minimum gas amount requirements. /// Minimum gas amount requirements.
/// </summary> /// </summary>
[field: DataField("minimumRequirements")] [DataField("minimumRequirements")]
public float[] MinimumRequirements { get; } = new float[Atmospherics.TotalNumberOfGases]; public float[] MinimumRequirements { get; } = new float[Atmospherics.TotalNumberOfGases];
/// <summary> /// <summary>
/// Maximum temperature requirement. /// Maximum temperature requirement.
/// </summary> /// </summary>
[field: DataField("maximumTemperature")] [DataField("maximumTemperature")]
public float MaximumTemperatureRequirement { get; } = float.MaxValue; public float MaximumTemperatureRequirement { get; } = float.MaxValue;
/// <summary> /// <summary>
/// Minimum temperature requirement. /// Minimum temperature requirement.
/// </summary> /// </summary>
[field: DataField("minimumTemperature")] [DataField("minimumTemperature")]
public float MinimumTemperatureRequirement { get; } = Atmospherics.TCMB; public float MinimumTemperatureRequirement { get; } = Atmospherics.TCMB;
/// <summary> /// <summary>
/// Minimum energy requirement. /// Minimum energy requirement.
/// </summary> /// </summary>
[field: DataField("minimumEnergy")] [DataField("minimumEnergy")]
public float MinimumEnergyRequirement { get; } = 0f; public float MinimumEnergyRequirement { get; } = 0f;
/// <summary> /// <summary>
/// Lower numbers are checked/react later than higher numbers. /// Lower numbers are checked/react later than higher numbers.
/// If two reactions have the same priority, they may happen in either order. /// If two reactions have the same priority, they may happen in either order.
/// </summary> /// </summary>
[field: DataField("priority")] [DataField("priority")]
public int Priority { get; } = int.MinValue; public int Priority { get; } = int.MinValue;
/// <summary> /// <summary>

View File

@@ -5,7 +5,6 @@ using Content.Shared.Chemistry;
using Content.Shared.Maps; using Content.Shared.Maps;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Atmos.Reactions namespace Content.Server.Atmos.Reactions
@@ -14,13 +13,13 @@ namespace Content.Server.Atmos.Reactions
[DataDefinition] [DataDefinition]
public class WaterVaporReaction : IGasReactionEffect public class WaterVaporReaction : IGasReactionEffect
{ {
[field: DataField("reagent")] public string? Reagent { get; } = null; [DataField("reagent")] public string? Reagent { get; } = null;
[field: DataField("gas")] public int GasId { get; } = 0; [DataField("gas")] public int GasId { get; } = 0;
[field: DataField("molesPerUnit")] public float MolesPerUnit { get; } = 1; [DataField("molesPerUnit")] public float MolesPerUnit { get; } = 1;
[field: DataField("puddlePrototype")] public string? PuddlePrototype { get; } = "PuddleSmear"; [DataField("puddlePrototype")] public string? PuddlePrototype { get; } = "PuddleSmear";
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, GridTileLookupSystem gridTileLookup) public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, GridTileLookupSystem gridTileLookup)
{ {

View File

@@ -76,7 +76,7 @@ namespace Content.Server.Botany
private const string SeedPrototype = "SeedBase"; private const string SeedPrototype = "SeedBase";
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; private init; } = default!; public string ID { get; private init; } = default!;
/// <summary> /// <summary>

View File

@@ -11,13 +11,13 @@ namespace Content.Server.Construction.Completions
[DataDefinition] [DataDefinition]
public class ConditionalAction : IGraphAction public class ConditionalAction : IGraphAction
{ {
[field: DataField("passUser")] public bool PassUser { get; } = false; [DataField("passUser")] public bool PassUser { get; } = false;
[field: DataField("condition", required:true)] public IGraphCondition? Condition { get; } = null; [DataField("condition", required:true)] public IGraphCondition? Condition { get; } = null;
[field: DataField("action", required:true)] public IGraphAction? Action { get; } = null; [DataField("action", required:true)] public IGraphAction? Action { get; } = null;
[field: DataField("else")] public IGraphAction? Else { get; } = null; [DataField("else")] public IGraphAction? Else { get; } = null;
public async Task PerformAction(IEntity entity, IEntity? user) public async Task PerformAction(IEntity entity, IEntity? user)
{ {

View File

@@ -11,7 +11,7 @@ namespace Content.Server.Construction.Completions
[DataDefinition] [DataDefinition]
public class DeleteEntitiesInContainer : IGraphAction public class DeleteEntitiesInContainer : IGraphAction
{ {
[field: DataField("container")] public string Container { get; } = string.Empty; [DataField("container")] public string Container { get; } = string.Empty;
public async Task PerformAction(IEntity entity, IEntity? user) public async Task PerformAction(IEntity entity, IEntity? user)
{ {

View File

@@ -13,8 +13,8 @@ namespace Content.Server.Construction.Completions
[DataDefinition] [DataDefinition]
public class MoveContainer : IGraphAction public class MoveContainer : IGraphAction
{ {
[field: DataField("from")] public string? FromContainer { get; } = null; [DataField("from")] public string? FromContainer { get; } = null;
[field: DataField("to")] public string? ToContainer { get; } = null; [DataField("to")] public string? ToContainer { get; } = null;
public async Task PerformAction(IEntity entity, IEntity? user) public async Task PerformAction(IEntity entity, IEntity? user)
{ {

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Construction.Completions
[DataDefinition] [DataDefinition]
public class PopupEveryone : IGraphAction public class PopupEveryone : IGraphAction
{ {
[field: DataField("text")] public string Text { get; } = string.Empty; [DataField("text")] public string Text { get; } = string.Empty;
public async Task PerformAction(IEntity entity, IEntity? user) public async Task PerformAction(IEntity entity, IEntity? user)
{ {

View File

@@ -12,8 +12,8 @@ namespace Content.Server.Construction.Completions
[DataDefinition] [DataDefinition]
public class PopupUser : IGraphAction public class PopupUser : IGraphAction
{ {
[field: DataField("cursor")] public bool Cursor { get; } = false; [DataField("cursor")] public bool Cursor { get; } = false;
[field: DataField("text")] public string Text { get; } = string.Empty; [DataField("text")] public string Text { get; } = string.Empty;
public async Task PerformAction(IEntity entity, IEntity? user) public async Task PerformAction(IEntity entity, IEntity? user)
{ {

View File

@@ -1,5 +1,4 @@
#nullable enable #nullable enable
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Content.Shared.Construction; using Content.Shared.Construction;
using JetBrains.Annotations; using JetBrains.Annotations;
@@ -13,9 +12,9 @@ namespace Content.Server.Construction.Completions
[DataDefinition] [DataDefinition]
public class SpawnPrototypeAtContainer : IGraphAction public class SpawnPrototypeAtContainer : IGraphAction
{ {
[field: DataField("prototype")] public string Prototype { get; } = string.Empty; [DataField("prototype")] public string Prototype { get; } = string.Empty;
[field: DataField("container")] public string Container { get; } = string.Empty; [DataField("container")] public string Container { get; } = string.Empty;
[field: DataField("amount")] public int Amount { get; } = 1; [DataField("amount")] public int Amount { get; } = 1;
public async Task PerformAction(IEntity entity, IEntity? user) public async Task PerformAction(IEntity entity, IEntity? user)
{ {

View File

@@ -11,7 +11,7 @@ namespace Content.Server.Construction.Conditions
[DataDefinition] [DataDefinition]
public class AllConditions : IGraphCondition public class AllConditions : IGraphCondition
{ {
[field: DataField("conditions")] [DataField("conditions")]
public IGraphCondition[] Conditions { get; } = Array.Empty<IGraphCondition>(); public IGraphCondition[] Conditions { get; } = Array.Empty<IGraphCondition>();
public async Task<bool> Condition(IEntity entity) public async Task<bool> Condition(IEntity entity)

View File

@@ -11,7 +11,7 @@ namespace Content.Server.Construction.Conditions
[DataDefinition] [DataDefinition]
public class AnyConditions : IGraphCondition public class AnyConditions : IGraphCondition
{ {
[field: DataField("conditions")] [DataField("conditions")]
public IGraphCondition[] Conditions { get; } = Array.Empty<IGraphCondition>(); public IGraphCondition[] Conditions { get; } = Array.Empty<IGraphCondition>();
public async Task<bool> Condition(IEntity entity) public async Task<bool> Condition(IEntity entity)

View File

@@ -12,7 +12,7 @@ namespace Content.Server.GameObjects.Components.AI
// These are immutable so any dynamic changes aren't saved back over. // These are immutable so any dynamic changes aren't saved back over.
// AiFactionSystem will just read these and then store them. // AiFactionSystem will just read these and then store them.
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[DataField("hostile")] [DataField("hostile")]

View File

@@ -34,7 +34,7 @@ namespace Content.Server.GameObjects.Components.Access
/// List of access lists to check allowed against. For an access check to pass /// List of access lists to check allowed against. For an access check to pass
/// there has to be an access list that is a subset of the access in the checking list. /// there has to be an access list that is a subset of the access in the checking list.
/// </summary> /// </summary>
[field: DataField("access")] [DataField("access")]
[ViewVariables] [ViewVariables]
public List<HashSet<string>> AccessLists { get; } = new(); public List<HashSet<string>> AccessLists { get; } = new();

View File

@@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components
/// Minimum time to wait before saying a new ad, in seconds. Has to be larger than or equal to 1. /// Minimum time to wait before saying a new ad, in seconds. Has to be larger than or equal to 1.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("minWait")] [DataField("minWait")]
private int MinWait { get; } = 480; // 8 minutes private int MinWait { get; } = 480; // 8 minutes
/// <summary> /// <summary>
@@ -32,10 +32,10 @@ namespace Content.Server.GameObjects.Components
/// to <see cref="MinWait"/> /// to <see cref="MinWait"/>
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("maxWait")] [DataField("maxWait")]
private int MaxWait { get; } = 600; // 10 minutes private int MaxWait { get; } = 600; // 10 minutes
[field: DataField("pack")] [DataField("pack")]
private string PackPrototypeId { get; } = string.Empty; private string PackPrototypeId { get; } = string.Empty;
private List<string> _advertisements = new(); private List<string> _advertisements = new();

View File

@@ -1,7 +1,6 @@
#nullable enable #nullable enable
using Content.Server.GameObjects.EntitySystems; using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Log; using Robust.Shared.Log;
@@ -45,7 +44,7 @@ namespace Content.Server.GameObjects.Components.Atmos
private bool _fixAirBlockedDirectionInitialize = true; private bool _fixAirBlockedDirectionInitialize = true;
[ViewVariables] [ViewVariables]
[field: DataField("noAirWhenFullyAirBlocked")] [DataField("noAirWhenFullyAirBlocked")]
public bool NoAirWhenFullyAirBlocked { get; } = true; public bool NoAirWhenFullyAirBlocked { get; } = true;
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]

View File

@@ -13,7 +13,7 @@ namespace Content.Server.GameObjects.Components.BarSign
private string _name = ""; private string _name = "";
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;

View File

@@ -17,8 +17,8 @@ using Robust.Shared.Player;
using Robust.Shared.Players; using Robust.Shared.Players;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components namespace Content.Server.GameObjects.Components
{ {
@@ -38,7 +38,7 @@ namespace Content.Server.GameObjects.Components
public int Charges { get; set; } public int Charges { get; set; }
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[field: DataField("capacity")] [DataField("capacity")]
public int Capacity { get; set; } = 30; public int Capacity { get; set; } = 30;
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(CrayonUiKey.Key); [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(CrayonUiKey.Key);

View File

@@ -14,7 +14,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Triggers
[DataDefinition] [DataDefinition]
public class OrTrigger : IThresholdTrigger public class OrTrigger : IThresholdTrigger
{ {
[field: DataField("triggers")] [DataField("triggers")]
public List<IThresholdTrigger> Triggers { get; } = new(); public List<IThresholdTrigger> Triggers { get; } = new();
public bool Reached(IDamageableComponent damageable, DestructibleSystem system) public bool Reached(IDamageableComponent damageable, DestructibleSystem system)

View File

@@ -1,11 +1,11 @@
#nullable enable #nullable enable
using System.Threading;
using Content.Shared.GameObjects; using Content.Shared.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
using System.Threading;
namespace Content.Server.GameObjects.Components.Engineering namespace Content.Server.GameObjects.Components.Engineering
{ {
@@ -16,7 +16,7 @@ namespace Content.Server.GameObjects.Components.Engineering
public override uint? NetID => ContentNetIDs.DISASSEMBLE_ON_ACTIVATE; public override uint? NetID => ContentNetIDs.DISASSEMBLE_ON_ACTIVATE;
[ViewVariables] [ViewVariables]
[field: DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] [DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? Prototype { get; } public string? Prototype { get; }
[ViewVariables] [ViewVariables]

View File

@@ -15,7 +15,7 @@ namespace Content.Server.GameObjects.Components.Engineering
public override uint? NetID => ContentNetIDs.SPAWN_AFTER_INTERACT; public override uint? NetID => ContentNetIDs.SPAWN_AFTER_INTERACT;
[ViewVariables] [ViewVariables]
[field: DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] [DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? Prototype { get; } public string? Prototype { get; }
[ViewVariables] [ViewVariables]

View File

@@ -1,20 +1,17 @@
#nullable enable #nullable enable
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Chemistry; using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.EntitySystems.DoAfter;
using Content.Shared.Chemistry; using Content.Shared.Chemistry;
using Content.Shared.Interfaces; using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components; using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility; using Content.Shared.Utility;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Serialization;
using System.Threading.Tasks;
using Content.Server.GameObjects.EntitySystems.DoAfter;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.ViewVariables;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Fluids namespace Content.Server.GameObjects.Components.Fluids
{ {
@@ -52,7 +49,7 @@ namespace Content.Server.GameObjects.Components.Fluids
// Picking up a puddle requires multiple clicks // Picking up a puddle requires multiple clicks
// Dumping in a bucket requires 1 click // Dumping in a bucket requires 1 click
// Long-term you'd probably use a cooldown and start the pickup once we have some form of global cooldown // Long-term you'd probably use a cooldown and start the pickup once we have some form of global cooldown
[field: DataField("pickup_amount")] [DataField("pickup_amount")]
public ReagentUnit PickupAmount { get; } = ReagentUnit.New(5); public ReagentUnit PickupAmount { get; } = ReagentUnit.New(5);
[DataField("pickup_sound")] [DataField("pickup_sound")]

View File

@@ -22,22 +22,22 @@ namespace Content.Server.GameObjects.Components.Interactable
{ {
[DataField("behavior")] public ToolQuality Behavior { get; private set; } = ToolQuality.None; [DataField("behavior")] public ToolQuality Behavior { get; private set; } = ToolQuality.None;
[field: DataField("state")] [DataField("state")]
public string State { get; } = string.Empty; public string State { get; } = string.Empty;
[field: DataField("texture")] [DataField("texture")]
public string Texture { get; } = string.Empty; public string Texture { get; } = string.Empty;
[field: DataField("sprite")] [DataField("sprite")]
public string Sprite { get; } = string.Empty; public string Sprite { get; } = string.Empty;
[field: DataField("useSound")] [DataField("useSound")]
public string Sound { get; } = string.Empty; public string Sound { get; } = string.Empty;
[field: DataField("useSoundCollection")] [DataField("useSoundCollection")]
public string SoundCollection { get; } = string.Empty; public string SoundCollection { get; } = string.Empty;
[field: DataField("changeSound")] [DataField("changeSound")]
public string ChangeSound { get; } = string.Empty; public string ChangeSound { get; } = string.Empty;
} }

View File

@@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components.MachineLinking
/// 0 is unlimited range /// 0 is unlimited range
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("range")] [DataField("range")]
public float Range { get; private set; } = 10; public float Range { get; private set; } = 10;
[DataField("signalReceivers")] private List<EntityUid> _receiverIds = new(); [DataField("signalReceivers")] private List<EntityUid> _receiverIds = new();

View File

@@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Markers
private string? _jobId; private string? _jobId;
[field: ViewVariables(VVAccess.ReadWrite)] [field: ViewVariables(VVAccess.ReadWrite)]
[field: DataField("spawn_type")] [DataField("spawn_type")]
public SpawnPointType SpawnType { get; } = SpawnPointType.Unset; public SpawnPointType SpawnType { get; } = SpawnPointType.Unset;
public JobPrototype? Job => string.IsNullOrEmpty(_jobId) ? null : _prototypeManager.Index<JobPrototype>(_jobId); public JobPrototype? Job => string.IsNullOrEmpty(_jobId) ? null : _prototypeManager.Index<JobPrototype>(_jobId);

View File

@@ -16,7 +16,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
public override string Name => "CreamPie"; public override string Name => "CreamPie";
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[field: DataField("paralyzeTime")] [DataField("paralyzeTime")]
public float ParalyzeTime { get; set; } = 1f; public float ParalyzeTime { get; set; } = 1f;
public void PlaySound() public void PlaySound()

View File

@@ -3,10 +3,8 @@ using Content.Server.GameObjects.Components.Mobs;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.GameObjects.Components.Damage; using Content.Shared.GameObjects.Components.Damage;
using Content.Shared.GameObjects.Components.Projectiles; using Content.Shared.GameObjects.Components.Projectiles;
using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision; using Robust.Shared.Physics.Collision;
using Robust.Shared.Physics.Dynamics; using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Player; using Robust.Shared.Player;
@@ -32,7 +30,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
set => _damages = value; set => _damages = value;
} }
[field: DataField("deleteOnCollide")] [DataField("deleteOnCollide")]
public bool DeleteOnCollide { get; } = true; public bool DeleteOnCollide { get; } = true;
// Get that juicy FPS hit sound // Get that juicy FPS hit sound

View File

@@ -15,7 +15,7 @@ namespace Content.Server.GameObjects.Components.Research
/// Whether new recipes can be added to this database or not. /// Whether new recipes can be added to this database or not.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("static")] [DataField("static")]
public bool Static { get; private set; } = false; public bool Static { get; private set; } = false;
public override ComponentState GetComponentState(ICommonSession player) public override ComponentState GetComponentState(ICommonSession player)

View File

@@ -47,28 +47,28 @@ namespace Content.Server.GameObjects.Components.Strap
/// <summary> /// <summary>
/// The change in position to the strapped mob /// The change in position to the strapped mob
/// </summary> /// </summary>
[field: DataField("position")] [DataField("position")]
public StrapPosition Position { get; } = StrapPosition.None; public StrapPosition Position { get; } = StrapPosition.None;
/// <summary> /// <summary>
/// The sound to be played when a mob is buckled /// The sound to be played when a mob is buckled
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("buckleSound")] [DataField("buckleSound")]
public string BuckleSound { get; } = "/Audio/Effects/buckle.ogg"; public string BuckleSound { get; } = "/Audio/Effects/buckle.ogg";
/// <summary> /// <summary>
/// The sound to be played when a mob is unbuckled /// The sound to be played when a mob is unbuckled
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("unbuckleSound")] [DataField("unbuckleSound")]
public string UnbuckleSound { get; } = "/Audio/Effects/unbuckle.ogg"; public string UnbuckleSound { get; } = "/Audio/Effects/unbuckle.ogg";
/// <summary> /// <summary>
/// ID of the alert to show when buckled /// ID of the alert to show when buckled
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("buckledAlertType")] [DataField("buckledAlertType")]
public AlertType BuckledAlertType { get; } = AlertType.Buckled; public AlertType BuckledAlertType { get; } = AlertType.Buckled;
/// <summary> /// <summary>

View File

@@ -26,7 +26,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
public override string Name => "Ammo"; public override string Name => "Ammo";
[field: DataField("caliber")] [DataField("caliber")]
public BallisticCaliber Caliber { get; } = BallisticCaliber.Unspecified; public BallisticCaliber Caliber { get; } = BallisticCaliber.Unspecified;
public bool Spent public bool Spent
@@ -53,7 +53,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
/// <summary> /// <summary>
/// Used for something that is deleted when the projectile is retrieved /// Used for something that is deleted when the projectile is retrieved
/// </summary> /// </summary>
[field: DataField("caseless")] [DataField("caseless")]
public bool Caseless { get; } public bool Caseless { get; }
// Rather than managing bullet / case state seemed easier to just have 2 toggles // Rather than managing bullet / case state seemed easier to just have 2 toggles
@@ -62,26 +62,26 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition
/// <summary> /// <summary>
/// For shotguns where they might shoot multiple entities /// For shotguns where they might shoot multiple entities
/// </summary> /// </summary>
[field: DataField("projectilesFired")] [DataField("projectilesFired")]
public int ProjectilesFired { get; } = 1; public int ProjectilesFired { get; } = 1;
[DataField("projectile")] [DataField("projectile")]
private string? _projectileId; private string? _projectileId;
// How far apart each entity is if multiple are shot // How far apart each entity is if multiple are shot
[field: DataField("ammoSpread")] [DataField("ammoSpread")]
public float EvenSpreadAngle { get; } = default; public float EvenSpreadAngle { get; } = default;
/// <summary> /// <summary>
/// How fast the shot entities travel /// How fast the shot entities travel
/// </summary> /// </summary>
[field: DataField("ammoVelocity")] [DataField("ammoVelocity")]
public float Velocity { get; } = 20f; public float Velocity { get; } = 20f;
[DataField("muzzleFlash")] [DataField("muzzleFlash")]
private string _muzzleFlashSprite = "Objects/Weapons/Guns/Projectiles/bullet_muzzle.png"; private string _muzzleFlashSprite = "Objects/Weapons/Guns/Projectiles/bullet_muzzle.png";
[field: DataField("soundCollectionEject")] [DataField("soundCollectionEject")]
public string? SoundCollectionEject { get; } = "CasingEject"; public string? SoundCollectionEject { get; } = "CasingEject";
void ISerializationHooks.AfterDeserialization() void ISerializationHooks.AfterDeserialization()

View File

@@ -39,7 +39,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
} }
private const int DefaultCapacity = 6; private const int DefaultCapacity = 6;
[field: DataField("capacity")] [DataField("capacity")]
public override int Capacity { get; } = DefaultCapacity; public override int Capacity { get; } = DefaultCapacity;
// Even a point having a chamber? I guess it makes some of the below code cleaner // Even a point having a chamber? I guess it makes some of the below code cleaner

View File

@@ -10,7 +10,6 @@ using Content.Shared.GameObjects.Components.Damage;
using Content.Shared.GameObjects.Components.Weapons.Ranged; using Content.Shared.GameObjects.Components.Weapons.Ranged;
using Content.Shared.GameObjects.EntitySystems; using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces.GameObjects.Components; using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Asynchronous;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
@@ -51,7 +50,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
[DataField("allSelectors")] [DataField("allSelectors")]
private FireRateSelector _allRateSelectors; private FireRateSelector _allRateSelectors;
[field: DataField("fireRate")] [DataField("fireRate")]
public override float FireRate { get; } = 2f; public override float FireRate { get; } = 2f;
// _lastFire is when we actually fired (so if we hold the button then recoil doesn't build up if we're not firing) // _lastFire is when we actually fired (so if we hold the button then recoil doesn't build up if we're not firing)
@@ -93,14 +92,14 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
[DataField("ammoSpreadRatio")] [DataField("ammoSpreadRatio")]
public float SpreadRatio { get; private set; } public float SpreadRatio { get; private set; }
[field: DataField("canMuzzleFlash")] [DataField("canMuzzleFlash")]
public bool CanMuzzleFlash { get; } = true; public bool CanMuzzleFlash { get; } = true;
// Sounds // Sounds
[field: DataField("soundGunshot")] [DataField("soundGunshot")]
public string? SoundGunshot { get; set; } public string? SoundGunshot { get; set; }
[field: DataField("soundEmpty")] [DataField("soundEmpty")]
public string SoundEmpty { get; } = "/Audio/Weapons/Guns/Empty/empty.ogg"; public string SoundEmpty { get; } = "/Audio/Weapons/Guns/Empty/empty.ogg";
void ISerializationHooks.BeforeSerialization() void ISerializationHooks.BeforeSerialization()

View File

@@ -16,7 +16,7 @@ namespace Content.Server.Holiday
[ViewVariables] [DataField("name")] public string Name { get; private set; } = string.Empty; [ViewVariables] [DataField("name")] public string Name { get; private set; } = string.Empty;
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[ViewVariables] [ViewVariables]

View File

@@ -13,7 +13,7 @@ namespace Content.Server.Objectives
public class ObjectivePrototype : IPrototype public class ObjectivePrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[ViewVariables] [DataField("issuer")] public string Issuer { get; private set; } = "Unknown"; [ViewVariables] [DataField("issuer")] public string Issuer { get; private set; } = "Unknown";

View File

@@ -13,7 +13,7 @@ namespace Content.Shared.Access
public class AccessLevelPrototype : IPrototype public class AccessLevelPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>

View File

@@ -22,7 +22,7 @@ namespace Content.Shared.Actions
/// Icon representing this action in the UI. /// Icon representing this action in the UI.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("icon")] [DataField("icon")]
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid; public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
/// <summary> /// <summary>
@@ -30,7 +30,7 @@ namespace Content.Shared.Actions
/// the action will simply be highlighted when turned on. /// the action will simply be highlighted when turned on.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("iconOn")] [DataField("iconOn")]
public SpriteSpecifier IconOn { get; } = SpriteSpecifier.Invalid; public SpriteSpecifier IconOn { get; } = SpriteSpecifier.Invalid;
/// <summary> /// <summary>
@@ -42,14 +42,14 @@ namespace Content.Shared.Actions
/// <summary> /// <summary>
/// Description to show in UI. Accepts formatting. /// Description to show in UI. Accepts formatting.
/// </summary> /// </summary>
[field: DataField("description")] [DataField("description")]
public FormattedMessage Description { get; } = new(); public FormattedMessage Description { get; } = new();
/// <summary> /// <summary>
/// Requirements message to show in UI. Accepts formatting, but generally should be avoided /// Requirements message to show in UI. Accepts formatting, but generally should be avoided
/// so the requirements message isn't too prominent in the tooltip. /// so the requirements message isn't too prominent in the tooltip.
/// </summary> /// </summary>
[field: DataField("requires")] [DataField("requires")]
public string Requires { get; } = string.Empty; public string Requires { get; } = string.Empty;
/// <summary> /// <summary>
@@ -63,21 +63,21 @@ namespace Content.Shared.Actions
/// selected after it is used, so it can be continuously re-used. If this is false, /// selected after it is used, so it can be continuously re-used. If this is false,
/// the action will be deselected after one use. /// the action will be deselected after one use.
/// </summary> /// </summary>
[field: DataField("repeat")] [DataField("repeat")]
public bool Repeat { get; } public bool Repeat { get; }
/// <summary> /// <summary>
/// For TargetEntity/TargetPoint actions, should the action be de-selected if currently selected (choosing a target) /// For TargetEntity/TargetPoint actions, should the action be de-selected if currently selected (choosing a target)
/// when it goes on cooldown. Defaults to false. /// when it goes on cooldown. Defaults to false.
/// </summary> /// </summary>
[field: DataField("deselectOnCooldown")] [DataField("deselectOnCooldown")]
public bool DeselectOnCooldown { get; } public bool DeselectOnCooldown { get; }
/// <summary> /// <summary>
/// For TargetEntity actions, should the action be de-selected if the user doesn't click an entity when /// For TargetEntity actions, should the action be de-selected if the user doesn't click an entity when
/// selecting a target. Defaults to false. /// selecting a target. Defaults to false.
/// </summary> /// </summary>
[field: DataField("deselectWhenEntityNotClicked")] [DataField("deselectWhenEntityNotClicked")]
public bool DeselectWhenEntityNotClicked { get; } public bool DeselectWhenEntityNotClicked { get; }
[DataField("filters")] private List<string> _filters = new(); [DataField("filters")] private List<string> _filters = new();

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Alert
public class AlertOrderPrototype : IPrototype, IComparer<AlertPrototype>, ISerializationHooks public class AlertOrderPrototype : IPrototype, IComparer<AlertPrototype>, ISerializationHooks
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[DataField("order")] private readonly List<(string type, string alert)> _order = new(); [DataField("order")] private readonly List<(string type, string alert)> _order = new();

View File

@@ -8,13 +8,13 @@ namespace Content.Shared.Atmos
[Prototype("gas")] [Prototype("gas")]
public class GasPrototype : IPrototype public class GasPrototype : IPrototype
{ {
[field: DataField("name")] public string Name { get; } = string.Empty; [DataField("name")] public string Name { get; } = string.Empty;
// TODO: Control gas amount necessary for overlay to appear // TODO: Control gas amount necessary for overlay to appear
// TODO: Add interfaces for gas behaviours e.g. breathing, burning // TODO: Add interfaces for gas behaviours e.g. breathing, burning
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>
@@ -39,7 +39,7 @@ namespace Content.Shared.Atmos
/// <summary> /// <summary>
/// Minimum amount of moles for this gas to be visible. /// Minimum amount of moles for this gas to be visible.
/// </summary> /// </summary>
[field: DataField("gasMolesVisible")] [DataField("gasMolesVisible")]
public float GasMolesVisible { get; } = 0.25f; public float GasMolesVisible { get; } = 0.25f;
/// <summary> /// <summary>
@@ -50,7 +50,7 @@ namespace Content.Shared.Atmos
/// <summary> /// <summary>
/// If this reagent is in gas form, this is the path to the overlay that will be used to make the gas visible. /// If this reagent is in gas form, this is the path to the overlay that will be used to make the gas visible.
/// </summary> /// </summary>
[field: DataField("gasOverlayTexture")] [DataField("gasOverlayTexture")]
public string GasOverlayTexture { get; } = string.Empty; public string GasOverlayTexture { get; } = string.Empty;
/// <summary> /// <summary>
@@ -68,9 +68,9 @@ namespace Content.Shared.Atmos
/// <summary> /// <summary>
/// Path to the tile overlay used when this gas appears visible. /// Path to the tile overlay used when this gas appears visible.
/// </summary> /// </summary>
[field: DataField("overlayPath")] [DataField("overlayPath")]
public string OverlayPath { get; } = string.Empty; public string OverlayPath { get; } = string.Empty;
[field: DataField("color")] public string Color { get; } = string.Empty; [DataField("color")] public string Color { get; } = string.Empty;
} }
} }

View File

@@ -10,9 +10,9 @@ namespace Content.Shared.Audio
public sealed class SoundCollectionPrototype : IPrototype public sealed class SoundCollectionPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("files")] public List<string> PickFiles { get; } = new(); [DataField("files")] public List<string> PickFiles { get; } = new();
} }
} }

View File

@@ -1,8 +1,6 @@
#nullable enable #nullable enable
using System.Collections.Generic; using System.Collections.Generic;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.Chemistry; using Content.Shared.Interfaces.Chemistry;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -20,10 +18,10 @@ namespace Content.Shared.Chemistry
[DataField("effects", serverOnly: true)] private List<IReactionEffect> _effects = new(); [DataField("effects", serverOnly: true)] private List<IReactionEffect> _effects = new();
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
/// <summary> /// <summary>

View File

@@ -1,5 +1,4 @@
using System; using System;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -17,15 +16,15 @@ namespace Content.Shared.Chemistry
public abstract class ReagentEntityReaction public abstract class ReagentEntityReaction
{ {
[ViewVariables] [ViewVariables]
[field: DataField("touch")] [DataField("touch")]
public bool Touch { get; } = false; public bool Touch { get; } = false;
[ViewVariables] [ViewVariables]
[field: DataField("injection")] [DataField("injection")]
public bool Injection { get; } = false; public bool Injection { get; } = false;
[ViewVariables] [ViewVariables]
[field: DataField("ingestion")] [DataField("ingestion")]
public bool Ingestion { get; } = false; public bool Ingestion { get; } = false;
public void React(ReactionMethod method, IEntity entity, ReagentPrototype reagent, ReagentUnit volume, Solution? source) public void React(ReactionMethod method, IEntity entity, ReagentPrototype reagent, ReagentUnit volume, Solution? source)

View File

@@ -2,7 +2,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Content.Shared.Interfaces.Chemistry; using Content.Shared.Interfaces.Chemistry;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Maths; using Robust.Shared.Maths;
@@ -29,34 +28,34 @@ namespace Content.Shared.Chemistry
private readonly float _customPlantMetabolism = 1f; private readonly float _customPlantMetabolism = 1f;
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
[field: DataField("desc")] [DataField("desc")]
public string Description { get; } = string.Empty; public string Description { get; } = string.Empty;
[field: DataField("physicalDesc")] [DataField("physicalDesc")]
public string PhysicalDescription { get; } = string.Empty; public string PhysicalDescription { get; } = string.Empty;
[field: DataField("color")] [DataField("color")]
public Color SubstanceColor { get; } = Color.White; public Color SubstanceColor { get; } = Color.White;
[field: DataField("toxin")] [DataField("toxin")]
public bool Toxin { get; } public bool Toxin { get; }
[field: DataField("boozePower")] [DataField("boozePower")]
public int BoozePower { get; } public int BoozePower { get; }
[field: DataField("boilingPoint")] [DataField("boilingPoint")]
public float? BoilingPoint { get; } public float? BoilingPoint { get; }
[field: DataField("meltingPoint")] [DataField("meltingPoint")]
public float? MeltingPoint { get; } public float? MeltingPoint { get; }
[field: DataField("spritePath")] [DataField("spritePath")]
public string SpriteReplacementPath { get; } = string.Empty; public string SpriteReplacementPath { get; } = string.Empty;
//List of metabolism effects this reagent has, should really only be used server-side. //List of metabolism effects this reagent has, should really only be used server-side.

View File

@@ -9,7 +9,7 @@ namespace Content.Shared.Construction
[DataDefinition] [DataDefinition]
public class ComponentConstructionGraphStep : ArbitraryInsertConstructionGraphStep public class ComponentConstructionGraphStep : ArbitraryInsertConstructionGraphStep
{ {
[field: DataField("component")] public string Component { get; } = string.Empty; [DataField("component")] public string Component { get; } = string.Empty;
public override bool EntityValid(IEntity entity) public override bool EntityValid(IEntity entity)
{ {

View File

@@ -17,11 +17,11 @@ namespace Content.Shared.Construction
private readonly Dictionary<string, Dictionary<ConstructionGraphNode, ConstructionGraphNode?>> _pathfinding = new(); private readonly Dictionary<string, Dictionary<ConstructionGraphNode, ConstructionGraphNode?>> _pathfinding = new();
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[ViewVariables] [ViewVariables]
[field: DataField("start")] [DataField("start")]
public string? Start { get; } public string? Start { get; }
[DataField("graph", priority: 0)] [DataField("graph", priority: 0)]

View File

@@ -15,37 +15,37 @@ namespace Content.Shared.Construction
/// <summary> /// <summary>
/// Friendly name displayed in the construction GUI. /// Friendly name displayed in the construction GUI.
/// </summary> /// </summary>
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
/// <summary> /// <summary>
/// "Useful" description displayed in the construction GUI. /// "Useful" description displayed in the construction GUI.
/// </summary> /// </summary>
[field: DataField("description")] [DataField("description")]
public string Description { get; } = string.Empty; public string Description { get; } = string.Empty;
/// <summary> /// <summary>
/// The <see cref="ConstructionGraphPrototype"/> this construction will be using. /// The <see cref="ConstructionGraphPrototype"/> this construction will be using.
/// </summary> /// </summary>
[field: DataField("graph")] [DataField("graph")]
public string Graph { get; } = string.Empty; public string Graph { get; } = string.Empty;
/// <summary> /// <summary>
/// The target <see cref="ConstructionGraphNode"/> this construction will guide the user to. /// The target <see cref="ConstructionGraphNode"/> this construction will guide the user to.
/// </summary> /// </summary>
[field: DataField("targetNode")] [DataField("targetNode")]
public string TargetNode { get; } = string.Empty; public string TargetNode { get; } = string.Empty;
/// <summary> /// <summary>
/// The starting <see cref="ConstructionGraphNode"/> this construction will start at. /// The starting <see cref="ConstructionGraphNode"/> this construction will start at.
/// </summary> /// </summary>
[field: DataField("startNode")] [DataField("startNode")]
public string StartNode { get; } = string.Empty; public string StartNode { get; } = string.Empty;
/// <summary> /// <summary>
/// Texture path inside the construction GUI. /// Texture path inside the construction GUI.
/// </summary> /// </summary>
[field: DataField("icon")] [DataField("icon")]
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid; public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
/// <summary> /// <summary>
@@ -59,16 +59,16 @@ namespace Content.Shared.Construction
[DataField("objectType")] public ConstructionType Type { get; private set; } = ConstructionType.Structure; [DataField("objectType")] public ConstructionType Type { get; private set; } = ConstructionType.Structure;
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("placementMode")] [DataField("placementMode")]
public string PlacementMode { get; } = "PlaceFree"; public string PlacementMode { get; } = "PlaceFree";
/// <summary> /// <summary>
/// Whether this construction can be constructed rotated or not. /// Whether this construction can be constructed rotated or not.
/// </summary> /// </summary>
[field: DataField("canRotate")] [DataField("canRotate")]
public bool CanRotate { get; } = true; public bool CanRotate { get; } = true;
public IReadOnlyList<IConstructionCondition> Conditions => _conditions; public IReadOnlyList<IConstructionCondition> Conditions => _conditions;

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Construction
[ImplicitDataDefinitionForInheritors] [ImplicitDataDefinitionForInheritors]
public abstract class EntityInsertConstructionGraphStep : ConstructionGraphStep public abstract class EntityInsertConstructionGraphStep : ConstructionGraphStep
{ {
[field: DataField("store")] public string Store { get; } = string.Empty; [DataField("store")] public string Store { get; } = string.Empty;
public abstract bool EntityValid(IEntity entity); public abstract bool EntityValid(IEntity entity);
} }

View File

@@ -16,9 +16,9 @@ namespace Content.Shared.Construction
{ {
// TODO: Make this use the material system. // TODO: Make this use the material system.
// TODO TODO: Make the material system not shit. // TODO TODO: Make the material system not shit.
[field: DataField("material")] public string MaterialPrototypeId { get; } = "Steel"; [DataField("material")] public string MaterialPrototypeId { get; } = "Steel";
[field: DataField("amount")] public int Amount { get; } = 1; [DataField("amount")] public int Amount { get; } = 1;
public StackPrototype MaterialPrototype => public StackPrototype MaterialPrototype =>
IoCManager.Resolve<IPrototypeManager>().Index<StackPrototype>(MaterialPrototypeId); IoCManager.Resolve<IPrototypeManager>().Index<StackPrototype>(MaterialPrototypeId);

View File

@@ -9,7 +9,7 @@ namespace Content.Shared.Construction
[DataDefinition] [DataDefinition]
public class PrototypeConstructionGraphStep : ArbitraryInsertConstructionGraphStep public class PrototypeConstructionGraphStep : ArbitraryInsertConstructionGraphStep
{ {
[field: DataField("prototype")] public string Prototype { get; } = string.Empty; [DataField("prototype")] public string Prototype { get; } = string.Empty;
public override bool EntityValid(IEntity entity) public override bool EntityValid(IEntity entity)
{ {

View File

@@ -9,11 +9,11 @@ namespace Content.Shared.Construction
[DataDefinition] [DataDefinition]
public class ToolConstructionGraphStep : ConstructionGraphStep public class ToolConstructionGraphStep : ConstructionGraphStep
{ {
[field: DataField("tool")] public ToolQuality Tool { get; } = ToolQuality.None; [DataField("tool")] public ToolQuality Tool { get; } = ToolQuality.None;
[field: DataField("fuel")] public float Fuel { get; } = 10; [DataField("fuel")] public float Fuel { get; } = 10;
[field: DataField("examine")] public string ExamineOverride { get; } = string.Empty; [DataField("examine")] public string ExamineOverride { get; } = string.Empty;
public override void DoExamine(FormattedMessage message, bool inDetailsRange) public override void DoExamine(FormattedMessage message, bool inDetailsRange)
{ {

View File

@@ -25,7 +25,7 @@ namespace Content.Shared.Damage.DamageContainer
[ViewVariables] public IReadOnlyCollection<DamageType> SupportedTypes => _supportedTypes; [ViewVariables] public IReadOnlyCollection<DamageType> SupportedTypes => _supportedTypes;
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
void ISerializationHooks.AfterDeserialization() void ISerializationHooks.AfterDeserialization()

View File

@@ -16,18 +16,18 @@ namespace Content.Shared.Damage.ResistanceSet
public class ResistanceSetPrototype : IPrototype, ISerializationHooks public class ResistanceSetPrototype : IPrototype, ISerializationHooks
{ {
[ViewVariables] [ViewVariables]
[field: DataField("coefficients")] [DataField("coefficients")]
public Dictionary<DamageType, float> Coefficients { get; } = new(); public Dictionary<DamageType, float> Coefficients { get; } = new();
[ViewVariables] [ViewVariables]
[field: DataField("flatReductions")] [DataField("flatReductions")]
public Dictionary<DamageType, int> FlatReductions { get; } = new(); public Dictionary<DamageType, int> FlatReductions { get; } = new();
[ViewVariables] [ViewVariables]
public Dictionary<DamageType, ResistanceSetSettings> Resistances { get; private set; } = new(); public Dictionary<DamageType, ResistanceSetSettings> Resistances { get; private set; } = new();
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
void ISerializationHooks.AfterDeserialization() void ISerializationHooks.AfterDeserialization()

View File

@@ -17,14 +17,14 @@ namespace Content.Shared.GameObjects.Components.Body.Preset
public class BodyPresetPrototype : IPrototype public class BodyPresetPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("partIDs")] [DataField("partIDs")]
private Dictionary<string, string> _partIDs = new(); private Dictionary<string, string> _partIDs = new();
[ViewVariables] [ViewVariables]
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
[ViewVariables] [ViewVariables]

View File

@@ -33,11 +33,11 @@ namespace Content.Shared.GameObjects.Components.Body
public override uint? NetID => ContentNetIDs.BODY; public override uint? NetID => ContentNetIDs.BODY;
[ViewVariables] [ViewVariables]
[field: DataField("template", required: true)] [DataField("template", required: true)]
private string? TemplateId { get; } = default; private string? TemplateId { get; } = default;
[ViewVariables] [ViewVariables]
[field: DataField("preset", required: true)] [DataField("preset", required: true)]
private string? PresetId { get; } = default; private string? PresetId { get; } = default;
[ViewVariables] [ViewVariables]

View File

@@ -16,28 +16,28 @@ namespace Content.Shared.GameObjects.Components.Body.Template
[Serializable, NetSerializable] [Serializable, NetSerializable]
public class BodyTemplatePrototype : IPrototype, ISerializationHooks public class BodyTemplatePrototype : IPrototype, ISerializationHooks
{ {
[field: DataField("slots")] [DataField("slots")]
private Dictionary<string, BodyPartType> _slots = new(); private Dictionary<string, BodyPartType> _slots = new();
[field: DataField("connections")] [DataField("connections")]
private Dictionary<string, List<string>> _rawConnections = new(); private Dictionary<string, List<string>> _rawConnections = new();
[field: DataField("layers")] [DataField("layers")]
private Dictionary<string, string> _layers = new(); private Dictionary<string, string> _layers = new();
[field: DataField("mechanismLayers")] [DataField("mechanismLayers")]
private Dictionary<string, string> _mechanismLayers = new(); private Dictionary<string, string> _mechanismLayers = new();
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[ViewVariables] [ViewVariables]
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
[ViewVariables] [ViewVariables]
[field: DataField("centerSlot")] [DataField("centerSlot")]
public string CenterSlot { get; } = string.Empty; public string CenterSlot { get; } = string.Empty;
[ViewVariables] [ViewVariables]

View File

@@ -10,7 +10,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry
{ {
public override string Name => "Reactive"; public override string Name => "Reactive";
[field: DataField("reactions", true, serverOnly:true)] [DataField("reactions", true, serverOnly:true)]
public ReagentEntityReaction[] Reactions { get; } = Array.Empty<ReagentEntityReaction>(); public ReagentEntityReaction[] Reactions { get; } = Array.Empty<ReagentEntityReaction>();
} }
} }

View File

@@ -21,7 +21,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry.ReagentDispenser
private List<string> _inventory = new(); private List<string> _inventory = new();
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
public List<string> Inventory => _inventory; public List<string> Inventory => _inventory;

View File

@@ -78,11 +78,11 @@ namespace Content.Shared.GameObjects.Components
public class CrayonDecalPrototype : IPrototype public class CrayonDecalPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("spritePath")] public string SpritePath { get; } = string.Empty; [DataField("spritePath")] public string SpritePath { get; } = string.Empty;
[field: DataField("decals")] public List<string> Decals { get; } = new(); [DataField("decals")] public List<string> Decals { get; } = new();
} }
} }

View File

@@ -56,7 +56,7 @@ namespace Content.Shared.GameObjects.Components
[ViewVariables] public int AvailableSpace => MaxCount - Count; [ViewVariables] public int AvailableSpace => MaxCount - Count;
[ViewVariables] [ViewVariables]
[field: DataField("stackType")] [DataField("stackType")]
public string StackTypeId { get; } = string.Empty; public string StackTypeId { get; } = string.Empty;
public StackPrototype StackType => _prototypeManager.Index<StackPrototype>(StackTypeId); public StackPrototype StackType => _prototypeManager.Index<StackPrototype>(StackTypeId);

View File

@@ -11,39 +11,39 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
public sealed class MeleeWeaponAnimationPrototype : IPrototype public sealed class MeleeWeaponAnimationPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[ViewVariables] [ViewVariables]
[field: DataField("state")] [DataField("state")]
public string State { get; } = string.Empty; public string State { get; } = string.Empty;
[ViewVariables] [ViewVariables]
[field: DataField("prototype")] [DataField("prototype")]
public string Prototype { get; } = "WeaponArc"; public string Prototype { get; } = "WeaponArc";
[ViewVariables] [ViewVariables]
[field: DataField("length")] [DataField("length")]
public TimeSpan Length { get; } = TimeSpan.FromSeconds(0.5f); public TimeSpan Length { get; } = TimeSpan.FromSeconds(0.5f);
[ViewVariables] [ViewVariables]
[field: DataField("speed")] [DataField("speed")]
public float Speed { get; } = 1; public float Speed { get; } = 1;
[ViewVariables] [ViewVariables]
[field: DataField("color")] [DataField("color")]
public Vector4 Color { get; } = new(1,1,1,1); public Vector4 Color { get; } = new(1,1,1,1);
[ViewVariables] [ViewVariables]
[field: DataField("colorDelta")] [DataField("colorDelta")]
public Vector4 ColorDelta { get; } = Vector4.Zero; public Vector4 ColorDelta { get; } = Vector4.Zero;
[ViewVariables] [ViewVariables]
[field: DataField("arcType")] [DataField("arcType")]
public WeaponArcType ArcType { get; } = WeaponArcType.Slash; public WeaponArcType ArcType { get; } = WeaponArcType.Slash;
[ViewVariables] [ViewVariables]
[field: DataField("width")] [DataField("width")]
public float Width { get; } = 90; public float Width { get; } = 90;
} }

View File

@@ -15,27 +15,27 @@ namespace Content.Shared.Maps
[ViewVariables] [ViewVariables]
string IPrototype.ID => Name; string IPrototype.ID => Name;
[field: DataField("name", required: true)] public string Name { get; } = string.Empty; [DataField("name", required: true)] public string Name { get; } = string.Empty;
public ushort TileId { get; private set; } public ushort TileId { get; private set; }
[field: DataField("display_name")] public string DisplayName { get; } = string.Empty; [DataField("display_name")] public string DisplayName { get; } = string.Empty;
[field: DataField("texture")] public string SpriteName { get; } = string.Empty; [DataField("texture")] public string SpriteName { get; } = string.Empty;
[DataField("is_subfloor")] public bool IsSubFloor { get; private set; } [DataField("is_subfloor")] public bool IsSubFloor { get; private set; }
[field: DataField("base_turfs")] public List<string> BaseTurfs { get; } = new(); [DataField("base_turfs")] public List<string> BaseTurfs { get; } = new();
[DataField("can_crowbar")] public bool CanCrowbar { get; private set; } [DataField("can_crowbar")] public bool CanCrowbar { get; private set; }
[field: DataField("footstep_sounds")] public string FootstepSounds { get; } = string.Empty; [DataField("footstep_sounds")] public string FootstepSounds { get; } = string.Empty;
[DataField("friction")] public float Friction { get; set; } [DataField("friction")] public float Friction { get; set; }
[DataField("thermalConductivity")] public float ThermalConductivity { get; set; } = 0.05f; [DataField("thermalConductivity")] public float ThermalConductivity { get; set; } = 0.05f;
[field: DataField("item_drop")] public string ItemDropPrototypeName { get; } = "FloorTileItemSteel"; [DataField("item_drop")] public string ItemDropPrototypeName { get; } = "FloorTileItemSteel";
[DataField("is_space")] public bool IsSpace { get; private set; } [DataField("is_space")] public bool IsSpace { get; private set; }

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Materials
public class MaterialPrototype : IPrototype, IInheritingPrototype public class MaterialPrototype : IPrototype, IInheritingPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[DataField("name")] public string Name { get; private set; } = "unobtanium"; [DataField("name")] public string Name { get; private set; } = "unobtanium";
@@ -82,10 +82,10 @@ namespace Content.Shared.Materials
[DataField("icon")] [DataField("icon")]
public SpriteSpecifier Icon { get; private set; } = SpriteSpecifier.Invalid; public SpriteSpecifier Icon { get; private set; } = SpriteSpecifier.Invalid;
[field: DataField("parent")] [DataField("parent")]
public string? Parent { get; } public string? Parent { get; }
[field: DataField("abstract")] [DataField("abstract")]
public bool Abstract { get; } public bool Abstract { get; }
} }
} }

View File

@@ -12,18 +12,18 @@ namespace Content.Shared.Preferences.Appearance
[Prototype("spriteAccessory")] [Prototype("spriteAccessory")]
public sealed class SpriteAccessoryPrototype : IPrototype, ISerializationHooks public sealed class SpriteAccessoryPrototype : IPrototype, ISerializationHooks
{ {
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("categories", required: true)] [DataField("categories", required: true)]
public SpriteAccessoryCategories Categories { get; } = default!; public SpriteAccessoryCategories Categories { get; } = default!;
public string Name { get; private set; } = default!; public string Name { get; private set; } = default!;
[field: DataField("sprite", required: true)] [DataField("sprite", required: true)]
public SpriteSpecifier Sprite { get; } = default!; public SpriteSpecifier Sprite { get; } = default!;
[field: DataField("priority")] public int Priority { get; } = 0; [DataField("priority")] public int Priority { get; } = 0;
void ISerializationHooks.AfterDeserialization() void ISerializationHooks.AfterDeserialization()
{ {

View File

@@ -17,7 +17,7 @@ namespace Content.Shared.Prototypes.Cargo
[DataField("description")] private string _description = string.Empty; [DataField("description")] private string _description = string.Empty;
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>
@@ -64,35 +64,35 @@ namespace Content.Shared.Prototypes.Cargo
/// Texture path used in the CargoConsole GUI. /// Texture path used in the CargoConsole GUI.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("icon")] [DataField("icon")]
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid; public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
/// <summary> /// <summary>
/// The prototype name of the product. /// The prototype name of the product.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("product")] [DataField("product")]
public string Product { get; } = string.Empty; public string Product { get; } = string.Empty;
/// <summary> /// <summary>
/// The point cost of the product. /// The point cost of the product.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("cost")] [DataField("cost")]
public int PointCost { get; } public int PointCost { get; }
/// <summary> /// <summary>
/// The prototype category of the product. (e.g. Engineering, Medical) /// The prototype category of the product. (e.g. Engineering, Medical)
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("category")] [DataField("category")]
public string Category { get; } = string.Empty; public string Category { get; } = string.Empty;
/// <summary> /// <summary>
/// The prototype group of the product. (e.g. Contraband) /// The prototype group of the product. (e.g. Contraband)
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("group")] [DataField("group")]
public string Group { get; } = string.Empty; public string Group { get; } = string.Empty;
} }
} }

View File

@@ -10,9 +10,9 @@ namespace Content.Shared.Prototypes
public class DatasetPrototype : IPrototype public class DatasetPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("values")] public IReadOnlyList<string> Values { get; } = new List<string>(); [DataField("values")] public IReadOnlyList<string> Values { get; } = new List<string>();
} }
} }

View File

@@ -12,11 +12,11 @@ namespace Content.Shared.Prototypes.EntityList
public class EntityListPrototype : IPrototype public class EntityListPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[ViewVariables] [ViewVariables]
[field: DataField("entities", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))] [DataField("entities", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
public ImmutableList<string> EntityIds { get; } = ImmutableList<string>.Empty; public ImmutableList<string> EntityIds { get; } = ImmutableList<string>.Empty;
public IEnumerable<EntityPrototype> Entities(IPrototypeManager? prototypeManager = null) public IEnumerable<EntityPrototype> Entities(IPrototypeManager? prototypeManager = null)

View File

@@ -6,13 +6,13 @@ namespace Content.Shared.Prototypes.HUD
[Prototype("hudTheme")] [Prototype("hudTheme")]
public class HudThemePrototype : IPrototype public class HudThemePrototype : IPrototype
{ {
[field: DataField("name", required: true)] [DataField("name", required: true)]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = string.Empty; public string ID { get; } = string.Empty;
[field: DataField("path", required: true)] [DataField("path", required: true)]
public string Path { get; } = string.Empty; public string Path { get; } = string.Empty;
} }
} }

View File

@@ -14,7 +14,7 @@ namespace Content.Shared.Prototypes.Kitchen
public class FoodRecipePrototype : IPrototype public class FoodRecipePrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[DataField("name")] [DataField("name")]
@@ -26,10 +26,10 @@ namespace Content.Shared.Prototypes.Kitchen
[DataField("solids")] [DataField("solids")]
private readonly Dictionary<string, int> _ingsSolids = new (); private readonly Dictionary<string, int> _ingsSolids = new ();
[field: DataField("result")] [DataField("result")]
public string Result { get; } = string.Empty; public string Result { get; } = string.Empty;
[field: DataField("time")] [DataField("time")]
public int CookTime { get; } = 5; public int CookTime { get; } = 5;
public string Name => Loc.GetString(_name); public string Name => Loc.GetString(_name);

View File

@@ -10,22 +10,22 @@ namespace Content.Shared.Prototypes.PDA
public class UplinkStoreListingPrototype : IPrototype public class UplinkStoreListingPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("itemId")] [DataField("itemId")]
public string ItemId { get; } = string.Empty; public string ItemId { get; } = string.Empty;
[field: DataField("price")] [DataField("price")]
public int Price { get; } = 5; public int Price { get; } = 5;
[field: DataField("category")] [DataField("category")]
public UplinkCategory Category { get; } = UplinkCategory.Utility; public UplinkCategory Category { get; } = UplinkCategory.Utility;
[field: DataField("description")] [DataField("description")]
public string Description { get; } = string.Empty; public string Description { get; } = string.Empty;
[field: DataField("listingName")] [DataField("listingName")]
public string ListingName { get; } = string.Empty; public string ListingName { get; } = string.Empty;
} }
} }

View File

@@ -14,7 +14,7 @@ namespace Content.Shared.Prototypes.Tag
public class TagPrototype : IPrototype public class TagPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
} }
} }

View File

@@ -14,7 +14,7 @@ namespace Content.Shared.Research
public class LatheRecipePrototype : IPrototype public class LatheRecipePrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[DataField("name")] [DataField("name")]

View File

@@ -16,48 +16,48 @@ namespace Content.Shared.Research
/// The ID of this technology prototype. /// The ID of this technology prototype.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>
/// The name this technology will have on user interfaces. /// The name this technology will have on user interfaces.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
/// <summary> /// <summary>
/// An icon that represent this technology. /// An icon that represent this technology.
/// </summary> /// </summary>
[field: DataField("icon")] [DataField("icon")]
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid; public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
/// <summary> /// <summary>
/// A short description of the technology. /// A short description of the technology.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("description")] [DataField("description")]
public string Description { get; } = string.Empty; public string Description { get; } = string.Empty;
/// <summary> /// <summary>
/// The required research points to unlock this technology. /// The required research points to unlock this technology.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("requiredPoints")] [DataField("requiredPoints")]
public int RequiredPoints { get; } public int RequiredPoints { get; }
/// <summary> /// <summary>
/// A list of technology IDs required to unlock this technology. /// A list of technology IDs required to unlock this technology.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("requiredTechnologies")] [DataField("requiredTechnologies")]
public List<string> RequiredTechnologies { get; } = new(); public List<string> RequiredTechnologies { get; } = new();
/// <summary> /// <summary>
/// A list of recipe IDs this technology unlocks. /// A list of recipe IDs this technology unlocks.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[field: DataField("unlockedRecipes")] [DataField("unlockedRecipes")]
public List<string> UnlockedRecipes { get; } = new(); public List<string> UnlockedRecipes { get; } = new();
} }
} }

View File

@@ -1,5 +1,4 @@
#nullable enable #nullable enable
using Robust.Shared.Localization;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -13,13 +12,13 @@ namespace Content.Shared.Roles
public class AntagPrototype : IPrototype public class AntagPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>
/// The name of this antag as displayed to players. /// The name of this antag as displayed to players.
/// </summary> /// </summary>
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
/// <summary> /// <summary>

View File

@@ -16,13 +16,13 @@ namespace Content.Shared.Roles
private string _name = string.Empty; private string _name = string.Empty;
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
/// <summary> /// <summary>
/// The name of this job as displayed to players. /// The name of this job as displayed to players.
/// </summary> /// </summary>
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
/// <summary> /// <summary>
@@ -49,15 +49,15 @@ namespace Content.Shared.Roles
[DataField("startingGear")] [DataField("startingGear")]
public string? StartingGear { get; private set; } public string? StartingGear { get; private set; }
[field: DataField("icon")] public string Icon { get; } = string.Empty; [DataField("icon")] public string Icon { get; } = string.Empty;
[DataField("special")] [DataField("special")]
public JobSpecial? Special { get; private set; } public JobSpecial? Special { get; private set; }
[field: DataField("departments")] [DataField("departments")]
public IReadOnlyCollection<string> Departments { get; } = Array.Empty<string>(); public IReadOnlyCollection<string> Departments { get; } = Array.Empty<string>();
[field: DataField("access")] [DataField("access")]
public IReadOnlyCollection<string> Access { get; } = Array.Empty<string>(); public IReadOnlyCollection<string> Access { get; } = Array.Empty<string>();
} }
} }

View File

@@ -33,7 +33,7 @@ namespace Content.Shared.Roles
private Dictionary<string, string> _inHand = new(0); private Dictionary<string, string> _inHand = new(0);
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
public string GetGear(Slots slot, HumanoidCharacterProfile? profile) public string GetGear(Slots slot, HumanoidCharacterProfile? profile)

View File

@@ -10,19 +10,19 @@ namespace Content.Shared.Stacks
public class StackPrototype : IPrototype public class StackPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
[field: DataField("icon")] [DataField("icon")]
public SpriteSpecifier? Icon { get; } public SpriteSpecifier? Icon { get; }
/// <summary> /// <summary>
/// The entity id that will be spawned by default from this stack. /// The entity id that will be spawned by default from this stack.
/// </summary> /// </summary>
[field: DataField("spawn")] [DataField("spawn")]
public string? Spawn { get; } public string? Spawn { get; }
} }
} }

View File

@@ -12,22 +12,22 @@ namespace Content.Shared.VendingMachines
public class VendingMachineInventoryPrototype : IPrototype public class VendingMachineInventoryPrototype : IPrototype
{ {
[ViewVariables] [ViewVariables]
[field: DataField("id", required: true)] [DataField("id", required: true)]
public string ID { get; } = default!; public string ID { get; } = default!;
[field: DataField("name")] [DataField("name")]
public string Name { get; } = string.Empty; public string Name { get; } = string.Empty;
[field: DataField("description")] [DataField("description")]
public string Description { get; } = string.Empty; public string Description { get; } = string.Empty;
[field: DataField("animationDuration")] [DataField("animationDuration")]
public double AnimationDuration { get; } public double AnimationDuration { get; }
[field: DataField("spriteName")] [DataField("spriteName")]
public string SpriteName { get; } = string.Empty; public string SpriteName { get; } = string.Empty;
[field: DataField("startingInventory")] [DataField("startingInventory")]
public Dictionary<string, uint> StartingInventory { get; } = new(); public Dictionary<string, uint> StartingInventory { get; } = new();
} }
} }