Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -3,37 +3,36 @@ using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Weapons.Ranged.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class BallisticAmmoProviderComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("soundRack")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public SoundSpecifier? SoundRack = new SoundPathSpecifier("/Audio/Weapons/Guns/Cock/smg_cock.ogg");
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("soundInsert")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public SoundSpecifier? SoundInsert = new SoundPathSpecifier("/Audio/Weapons/Guns/MagIn/bullet_insert.ogg");
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("proto", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string? FillProto;
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public EntProtoId? Proto;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("capacity")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public int Capacity = 30;
|
||||
|
||||
public int Count => UnspawnedCount + Container.ContainedEntities.Count;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("unspawnedCount")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public int UnspawnedCount;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("whitelist")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public EntityWhitelist? Whitelist;
|
||||
|
||||
public Container Container = default!;
|
||||
|
||||
// TODO: Make this use stacks when the typeserializer is done.
|
||||
[DataField("entities")]
|
||||
[DataField, AutoNetworkedField]
|
||||
public List<EntityUid> Entities = new();
|
||||
|
||||
/// <summary>
|
||||
@@ -42,18 +41,18 @@ public sealed partial class BallisticAmmoProviderComponent : Component
|
||||
/// <remarks>
|
||||
/// Set to false for entities like turrets to avoid users being able to cycle them.
|
||||
/// </remarks>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("cycleable")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public bool Cycleable = true;
|
||||
|
||||
/// <summary>
|
||||
/// Is it okay for this entity to directly transfer its valid ammunition into another provider?
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("mayTransfer")]
|
||||
public bool MayTransfer = false;
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public bool MayTransfer;
|
||||
|
||||
/// <summary>
|
||||
/// DoAfter delay for filling a bullet into another ballistic ammo provider.
|
||||
/// </summary>
|
||||
[DataField("fillDelay")]
|
||||
[DataField]
|
||||
public TimeSpan FillDelay = TimeSpan.FromSeconds(0.5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user