Remove field: from DataField attributes (#3932)
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Content.Shared.Access
|
||||
public class AccessLevelPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Shared.Actions
|
||||
/// Icon representing this action in the UI.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("icon")]
|
||||
[DataField("icon")]
|
||||
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
|
||||
|
||||
/// <summary>
|
||||
@@ -30,7 +30,7 @@ namespace Content.Shared.Actions
|
||||
/// the action will simply be highlighted when turned on.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("iconOn")]
|
||||
[DataField("iconOn")]
|
||||
public SpriteSpecifier IconOn { get; } = SpriteSpecifier.Invalid;
|
||||
|
||||
/// <summary>
|
||||
@@ -42,14 +42,14 @@ namespace Content.Shared.Actions
|
||||
/// <summary>
|
||||
/// Description to show in UI. Accepts formatting.
|
||||
/// </summary>
|
||||
[field: DataField("description")]
|
||||
[DataField("description")]
|
||||
public FormattedMessage Description { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Requirements message to show in UI. Accepts formatting, but generally should be avoided
|
||||
/// so the requirements message isn't too prominent in the tooltip.
|
||||
/// </summary>
|
||||
[field: DataField("requires")]
|
||||
[DataField("requires")]
|
||||
public string Requires { get; } = string.Empty;
|
||||
|
||||
/// <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,
|
||||
/// the action will be deselected after one use.
|
||||
/// </summary>
|
||||
[field: DataField("repeat")]
|
||||
[DataField("repeat")]
|
||||
public bool Repeat { get; }
|
||||
|
||||
/// <summary>
|
||||
/// For TargetEntity/TargetPoint actions, should the action be de-selected if currently selected (choosing a target)
|
||||
/// when it goes on cooldown. Defaults to false.
|
||||
/// </summary>
|
||||
[field: DataField("deselectOnCooldown")]
|
||||
[DataField("deselectOnCooldown")]
|
||||
public bool DeselectOnCooldown { get; }
|
||||
|
||||
/// <summary>
|
||||
/// For TargetEntity actions, should the action be de-selected if the user doesn't click an entity when
|
||||
/// selecting a target. Defaults to false.
|
||||
/// </summary>
|
||||
[field: DataField("deselectWhenEntityNotClicked")]
|
||||
[DataField("deselectWhenEntityNotClicked")]
|
||||
public bool DeselectWhenEntityNotClicked { get; }
|
||||
|
||||
[DataField("filters")] private List<string> _filters = new();
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Shared.Alert
|
||||
public class AlertOrderPrototype : IPrototype, IComparer<AlertPrototype>, ISerializationHooks
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("order")] private readonly List<(string type, string alert)> _order = new();
|
||||
|
||||
@@ -8,13 +8,13 @@ namespace Content.Shared.Atmos
|
||||
[Prototype("gas")]
|
||||
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: Add interfaces for gas behaviours e.g. breathing, burning
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
@@ -39,7 +39,7 @@ namespace Content.Shared.Atmos
|
||||
/// <summary>
|
||||
/// Minimum amount of moles for this gas to be visible.
|
||||
/// </summary>
|
||||
[field: DataField("gasMolesVisible")]
|
||||
[DataField("gasMolesVisible")]
|
||||
public float GasMolesVisible { get; } = 0.25f;
|
||||
|
||||
/// <summary>
|
||||
@@ -50,7 +50,7 @@ namespace Content.Shared.Atmos
|
||||
/// <summary>
|
||||
/// If this reagent is in gas form, this is the path to the overlay that will be used to make the gas visible.
|
||||
/// </summary>
|
||||
[field: DataField("gasOverlayTexture")]
|
||||
[DataField("gasOverlayTexture")]
|
||||
public string GasOverlayTexture { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
@@ -68,9 +68,9 @@ namespace Content.Shared.Atmos
|
||||
/// <summary>
|
||||
/// Path to the tile overlay used when this gas appears visible.
|
||||
/// </summary>
|
||||
[field: DataField("overlayPath")]
|
||||
[DataField("overlayPath")]
|
||||
public string OverlayPath { get; } = string.Empty;
|
||||
|
||||
[field: DataField("color")] public string Color { get; } = string.Empty;
|
||||
[DataField("color")] public string Color { get; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Content.Shared.Audio
|
||||
public sealed class SoundCollectionPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("files")] public List<string> PickFiles { get; } = new();
|
||||
[DataField("files")] public List<string> PickFiles { get; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#nullable enable
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Interfaces;
|
||||
using Content.Shared.Interfaces.Chemistry;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -20,10 +18,10 @@ namespace Content.Shared.Chemistry
|
||||
[DataField("effects", serverOnly: true)] private List<IReactionEffect> _effects = new();
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -17,15 +16,15 @@ namespace Content.Shared.Chemistry
|
||||
public abstract class ReagentEntityReaction
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("touch")]
|
||||
[DataField("touch")]
|
||||
public bool Touch { get; } = false;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("injection")]
|
||||
[DataField("injection")]
|
||||
public bool Injection { get; } = false;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("ingestion")]
|
||||
[DataField("ingestion")]
|
||||
public bool Ingestion { get; } = false;
|
||||
|
||||
public void React(ReactionMethod method, IEntity entity, ReagentPrototype reagent, ReagentUnit volume, Solution? source)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Interfaces.Chemistry;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
@@ -29,34 +28,34 @@ namespace Content.Shared.Chemistry
|
||||
private readonly float _customPlantMetabolism = 1f;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
[field: DataField("desc")]
|
||||
[DataField("desc")]
|
||||
public string Description { get; } = string.Empty;
|
||||
|
||||
[field: DataField("physicalDesc")]
|
||||
[DataField("physicalDesc")]
|
||||
public string PhysicalDescription { get; } = string.Empty;
|
||||
|
||||
[field: DataField("color")]
|
||||
[DataField("color")]
|
||||
public Color SubstanceColor { get; } = Color.White;
|
||||
|
||||
[field: DataField("toxin")]
|
||||
[DataField("toxin")]
|
||||
public bool Toxin { get; }
|
||||
|
||||
[field: DataField("boozePower")]
|
||||
[DataField("boozePower")]
|
||||
public int BoozePower { get; }
|
||||
|
||||
[field: DataField("boilingPoint")]
|
||||
[DataField("boilingPoint")]
|
||||
public float? BoilingPoint { get; }
|
||||
|
||||
[field: DataField("meltingPoint")]
|
||||
[DataField("meltingPoint")]
|
||||
public float? MeltingPoint { get; }
|
||||
|
||||
[field: DataField("spritePath")]
|
||||
[DataField("spritePath")]
|
||||
public string SpriteReplacementPath { get; } = string.Empty;
|
||||
|
||||
//List of metabolism effects this reagent has, should really only be used server-side.
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Shared.Construction
|
||||
[DataDefinition]
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -17,11 +17,11 @@ namespace Content.Shared.Construction
|
||||
private readonly Dictionary<string, Dictionary<ConstructionGraphNode, ConstructionGraphNode?>> _pathfinding = new();
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("start")]
|
||||
[DataField("start")]
|
||||
public string? Start { get; }
|
||||
|
||||
[DataField("graph", priority: 0)]
|
||||
|
||||
@@ -15,37 +15,37 @@ namespace Content.Shared.Construction
|
||||
/// <summary>
|
||||
/// Friendly name displayed in the construction GUI.
|
||||
/// </summary>
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// "Useful" description displayed in the construction GUI.
|
||||
/// </summary>
|
||||
[field: DataField("description")]
|
||||
[DataField("description")]
|
||||
public string Description { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="ConstructionGraphPrototype"/> this construction will be using.
|
||||
/// </summary>
|
||||
[field: DataField("graph")]
|
||||
[DataField("graph")]
|
||||
public string Graph { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The target <see cref="ConstructionGraphNode"/> this construction will guide the user to.
|
||||
/// </summary>
|
||||
[field: DataField("targetNode")]
|
||||
[DataField("targetNode")]
|
||||
public string TargetNode { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The starting <see cref="ConstructionGraphNode"/> this construction will start at.
|
||||
/// </summary>
|
||||
[field: DataField("startNode")]
|
||||
[DataField("startNode")]
|
||||
public string StartNode { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Texture path inside the construction GUI.
|
||||
/// </summary>
|
||||
[field: DataField("icon")]
|
||||
[DataField("icon")]
|
||||
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
|
||||
|
||||
/// <summary>
|
||||
@@ -59,16 +59,16 @@ namespace Content.Shared.Construction
|
||||
[DataField("objectType")] public ConstructionType Type { get; private set; } = ConstructionType.Structure;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("placementMode")]
|
||||
[DataField("placementMode")]
|
||||
public string PlacementMode { get; } = "PlaceFree";
|
||||
|
||||
/// <summary>
|
||||
/// Whether this construction can be constructed rotated or not.
|
||||
/// </summary>
|
||||
[field: DataField("canRotate")]
|
||||
[DataField("canRotate")]
|
||||
public bool CanRotate { get; } = true;
|
||||
|
||||
public IReadOnlyList<IConstructionCondition> Conditions => _conditions;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Construction
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace Content.Shared.Construction
|
||||
{
|
||||
// TODO: Make this use the material system.
|
||||
// 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 =>
|
||||
IoCManager.Resolve<IPrototypeManager>().Index<StackPrototype>(MaterialPrototypeId);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Shared.Construction
|
||||
[DataDefinition]
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -9,11 +9,11 @@ namespace Content.Shared.Construction
|
||||
[DataDefinition]
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Shared.Damage.DamageContainer
|
||||
[ViewVariables] public IReadOnlyCollection<DamageType> SupportedTypes => _supportedTypes;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
|
||||
@@ -16,18 +16,18 @@ namespace Content.Shared.Damage.ResistanceSet
|
||||
public class ResistanceSetPrototype : IPrototype, ISerializationHooks
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("coefficients")]
|
||||
[DataField("coefficients")]
|
||||
public Dictionary<DamageType, float> Coefficients { get; } = new();
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("flatReductions")]
|
||||
[DataField("flatReductions")]
|
||||
public Dictionary<DamageType, int> FlatReductions { get; } = new();
|
||||
|
||||
[ViewVariables]
|
||||
public Dictionary<DamageType, ResistanceSetSettings> Resistances { get; private set; } = new();
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
|
||||
@@ -17,14 +17,14 @@ namespace Content.Shared.GameObjects.Components.Body.Preset
|
||||
public class BodyPresetPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("partIDs")]
|
||||
[DataField("partIDs")]
|
||||
private Dictionary<string, string> _partIDs = new();
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace Content.Shared.GameObjects.Components.Body
|
||||
public override uint? NetID => ContentNetIDs.BODY;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("template", required: true)]
|
||||
[DataField("template", required: true)]
|
||||
private string? TemplateId { get; } = default;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("preset", required: true)]
|
||||
[DataField("preset", required: true)]
|
||||
private string? PresetId { get; } = default;
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -16,28 +16,28 @@ namespace Content.Shared.GameObjects.Components.Body.Template
|
||||
[Serializable, NetSerializable]
|
||||
public class BodyTemplatePrototype : IPrototype, ISerializationHooks
|
||||
{
|
||||
[field: DataField("slots")]
|
||||
[DataField("slots")]
|
||||
private Dictionary<string, BodyPartType> _slots = new();
|
||||
|
||||
[field: DataField("connections")]
|
||||
[DataField("connections")]
|
||||
private Dictionary<string, List<string>> _rawConnections = new();
|
||||
|
||||
[field: DataField("layers")]
|
||||
[DataField("layers")]
|
||||
private Dictionary<string, string> _layers = new();
|
||||
|
||||
[field: DataField("mechanismLayers")]
|
||||
[DataField("mechanismLayers")]
|
||||
private Dictionary<string, string> _mechanismLayers = new();
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("centerSlot")]
|
||||
[DataField("centerSlot")]
|
||||
public string CenterSlot { get; } = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry
|
||||
{
|
||||
public override string Name => "Reactive";
|
||||
|
||||
[field: DataField("reactions", true, serverOnly:true)]
|
||||
[DataField("reactions", true, serverOnly:true)]
|
||||
public ReagentEntityReaction[] Reactions { get; } = Array.Empty<ReagentEntityReaction>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry.ReagentDispenser
|
||||
private List<string> _inventory = new();
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
public List<string> Inventory => _inventory;
|
||||
|
||||
@@ -78,11 +78,11 @@ namespace Content.Shared.GameObjects.Components
|
||||
public class CrayonDecalPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Content.Shared.GameObjects.Components
|
||||
[ViewVariables] public int AvailableSpace => MaxCount - Count;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("stackType")]
|
||||
[DataField("stackType")]
|
||||
public string StackTypeId { get; } = string.Empty;
|
||||
|
||||
public StackPrototype StackType => _prototypeManager.Index<StackPrototype>(StackTypeId);
|
||||
|
||||
@@ -11,39 +11,39 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
|
||||
public sealed class MeleeWeaponAnimationPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("state")]
|
||||
[DataField("state")]
|
||||
public string State { get; } = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("prototype")]
|
||||
[DataField("prototype")]
|
||||
public string Prototype { get; } = "WeaponArc";
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("length")]
|
||||
[DataField("length")]
|
||||
public TimeSpan Length { get; } = TimeSpan.FromSeconds(0.5f);
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("speed")]
|
||||
[DataField("speed")]
|
||||
public float Speed { get; } = 1;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("color")]
|
||||
[DataField("color")]
|
||||
public Vector4 Color { get; } = new(1,1,1,1);
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("colorDelta")]
|
||||
[DataField("colorDelta")]
|
||||
public Vector4 ColorDelta { get; } = Vector4.Zero;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("arcType")]
|
||||
[DataField("arcType")]
|
||||
public WeaponArcType ArcType { get; } = WeaponArcType.Slash;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("width")]
|
||||
[DataField("width")]
|
||||
public float Width { get; } = 90;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,27 +15,27 @@ namespace Content.Shared.Maps
|
||||
[ViewVariables]
|
||||
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; }
|
||||
|
||||
[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; }
|
||||
|
||||
[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; }
|
||||
|
||||
[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("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; }
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Shared.Materials
|
||||
public class MaterialPrototype : IPrototype, IInheritingPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("name")] public string Name { get; private set; } = "unobtanium";
|
||||
@@ -82,10 +82,10 @@ namespace Content.Shared.Materials
|
||||
[DataField("icon")]
|
||||
public SpriteSpecifier Icon { get; private set; } = SpriteSpecifier.Invalid;
|
||||
|
||||
[field: DataField("parent")]
|
||||
[DataField("parent")]
|
||||
public string? Parent { get; }
|
||||
|
||||
[field: DataField("abstract")]
|
||||
[DataField("abstract")]
|
||||
public bool Abstract { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,18 +12,18 @@ namespace Content.Shared.Preferences.Appearance
|
||||
[Prototype("spriteAccessory")]
|
||||
public sealed class SpriteAccessoryPrototype : IPrototype, ISerializationHooks
|
||||
{
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("categories", required: true)]
|
||||
[DataField("categories", required: true)]
|
||||
public SpriteAccessoryCategories Categories { get; } = default!;
|
||||
|
||||
public string Name { get; private set; } = default!;
|
||||
|
||||
[field: DataField("sprite", required: true)]
|
||||
[DataField("sprite", required: true)]
|
||||
public SpriteSpecifier Sprite { get; } = default!;
|
||||
|
||||
[field: DataField("priority")] public int Priority { get; } = 0;
|
||||
[DataField("priority")] public int Priority { get; } = 0;
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Shared.Prototypes.Cargo
|
||||
[DataField("description")] private string _description = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
@@ -64,35 +64,35 @@ namespace Content.Shared.Prototypes.Cargo
|
||||
/// Texture path used in the CargoConsole GUI.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("icon")]
|
||||
[DataField("icon")]
|
||||
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
|
||||
|
||||
/// <summary>
|
||||
/// The prototype name of the product.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("product")]
|
||||
[DataField("product")]
|
||||
public string Product { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The point cost of the product.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("cost")]
|
||||
[DataField("cost")]
|
||||
public int PointCost { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The prototype category of the product. (e.g. Engineering, Medical)
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("category")]
|
||||
[DataField("category")]
|
||||
public string Category { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The prototype group of the product. (e.g. Contraband)
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("group")]
|
||||
[DataField("group")]
|
||||
public string Group { get; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Content.Shared.Prototypes
|
||||
public class DatasetPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
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>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace Content.Shared.Prototypes.EntityList
|
||||
public class EntityListPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("entities", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
||||
[DataField("entities", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
||||
public ImmutableList<string> EntityIds { get; } = ImmutableList<string>.Empty;
|
||||
|
||||
public IEnumerable<EntityPrototype> Entities(IPrototypeManager? prototypeManager = null)
|
||||
|
||||
@@ -6,13 +6,13 @@ namespace Content.Shared.Prototypes.HUD
|
||||
[Prototype("hudTheme")]
|
||||
public class HudThemePrototype : IPrototype
|
||||
{
|
||||
[field: DataField("name", required: true)]
|
||||
[DataField("name", required: true)]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = string.Empty;
|
||||
|
||||
[field: DataField("path", required: true)]
|
||||
[DataField("path", required: true)]
|
||||
public string Path { get; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Shared.Prototypes.Kitchen
|
||||
public class FoodRecipePrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("name")]
|
||||
@@ -26,10 +26,10 @@ namespace Content.Shared.Prototypes.Kitchen
|
||||
[DataField("solids")]
|
||||
private readonly Dictionary<string, int> _ingsSolids = new ();
|
||||
|
||||
[field: DataField("result")]
|
||||
[DataField("result")]
|
||||
public string Result { get; } = string.Empty;
|
||||
|
||||
[field: DataField("time")]
|
||||
[DataField("time")]
|
||||
public int CookTime { get; } = 5;
|
||||
|
||||
public string Name => Loc.GetString(_name);
|
||||
|
||||
@@ -10,22 +10,22 @@ namespace Content.Shared.Prototypes.PDA
|
||||
public class UplinkStoreListingPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("itemId")]
|
||||
[DataField("itemId")]
|
||||
public string ItemId { get; } = string.Empty;
|
||||
|
||||
[field: DataField("price")]
|
||||
[DataField("price")]
|
||||
public int Price { get; } = 5;
|
||||
|
||||
[field: DataField("category")]
|
||||
[DataField("category")]
|
||||
public UplinkCategory Category { get; } = UplinkCategory.Utility;
|
||||
|
||||
[field: DataField("description")]
|
||||
[DataField("description")]
|
||||
public string Description { get; } = string.Empty;
|
||||
|
||||
[field: DataField("listingName")]
|
||||
[DataField("listingName")]
|
||||
public string ListingName { get; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Shared.Prototypes.Tag
|
||||
public class TagPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Shared.Research
|
||||
public class LatheRecipePrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("name")]
|
||||
|
||||
@@ -16,48 +16,48 @@ namespace Content.Shared.Research
|
||||
/// The ID of this technology prototype.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The name this technology will have on user interfaces.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// An icon that represent this technology.
|
||||
/// </summary>
|
||||
[field: DataField("icon")]
|
||||
[DataField("icon")]
|
||||
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
|
||||
|
||||
/// <summary>
|
||||
/// A short description of the technology.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("description")]
|
||||
[DataField("description")]
|
||||
public string Description { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The required research points to unlock this technology.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("requiredPoints")]
|
||||
[DataField("requiredPoints")]
|
||||
public int RequiredPoints { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of technology IDs required to unlock this technology.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("requiredTechnologies")]
|
||||
[DataField("requiredTechnologies")]
|
||||
public List<string> RequiredTechnologies { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// A list of recipe IDs this technology unlocks.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[field: DataField("unlockedRecipes")]
|
||||
[DataField("unlockedRecipes")]
|
||||
public List<string> UnlockedRecipes { get; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#nullable enable
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -13,13 +12,13 @@ namespace Content.Shared.Roles
|
||||
public class AntagPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The name of this antag as displayed to players.
|
||||
/// </summary>
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,13 +16,13 @@ namespace Content.Shared.Roles
|
||||
private string _name = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The name of this job as displayed to players.
|
||||
/// </summary>
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
@@ -49,15 +49,15 @@ namespace Content.Shared.Roles
|
||||
[DataField("startingGear")]
|
||||
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")]
|
||||
public JobSpecial? Special { get; private set; }
|
||||
|
||||
[field: DataField("departments")]
|
||||
[DataField("departments")]
|
||||
public IReadOnlyCollection<string> Departments { get; } = Array.Empty<string>();
|
||||
|
||||
[field: DataField("access")]
|
||||
[DataField("access")]
|
||||
public IReadOnlyCollection<string> Access { get; } = Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Shared.Roles
|
||||
private Dictionary<string, string> _inHand = new(0);
|
||||
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
public string GetGear(Slots slot, HumanoidCharacterProfile? profile)
|
||||
|
||||
@@ -10,19 +10,19 @@ namespace Content.Shared.Stacks
|
||||
public class StackPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
[field: DataField("icon")]
|
||||
[DataField("icon")]
|
||||
public SpriteSpecifier? Icon { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The entity id that will be spawned by default from this stack.
|
||||
/// </summary>
|
||||
[field: DataField("spawn")]
|
||||
[DataField("spawn")]
|
||||
public string? Spawn { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,22 +12,22 @@ namespace Content.Shared.VendingMachines
|
||||
public class VendingMachineInventoryPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[field: DataField("id", required: true)]
|
||||
[DataField("id", required: true)]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[field: DataField("name")]
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
[field: DataField("description")]
|
||||
[DataField("description")]
|
||||
public string Description { get; } = string.Empty;
|
||||
|
||||
[field: DataField("animationDuration")]
|
||||
[DataField("animationDuration")]
|
||||
public double AnimationDuration { get; }
|
||||
|
||||
[field: DataField("spriteName")]
|
||||
[DataField("spriteName")]
|
||||
public string SpriteName { get; } = string.Empty;
|
||||
|
||||
[field: DataField("startingInventory")]
|
||||
[DataField("startingInventory")]
|
||||
public Dictionary<string, uint> StartingInventory { get; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user