2023-04-13 20:08:56 -05:00
|
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
|
using Robust.Shared.Prototypes;
|
2022-07-14 19:45:27 -07:00
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Weapons.Ranged.Components;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Simply provides a certain capacity of entities that cannot be reloaded through normal means and have
|
|
|
|
|
|
/// no special behavior like cycling, magazine
|
|
|
|
|
|
/// </summary>
|
2023-05-08 22:37:40 +10:00
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
2023-04-13 20:08:56 -05:00
|
|
|
|
public sealed partial class BasicEntityAmmoProviderComponent : AmmoProviderComponent
|
2022-07-14 19:45:27 -07:00
|
|
|
|
{
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
[DataField("proto", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
|
|
|
|
|
public string Proto = default!;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Max capacity.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
[DataField("capacity")]
|
2023-04-13 20:08:56 -05:00
|
|
|
|
[AutoNetworkedField]
|
2022-07-14 19:45:27 -07:00
|
|
|
|
public int? Capacity = null;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Actual ammo left. Initialized to capacity unless they are non-null and differ.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
[DataField("count")]
|
2023-04-13 20:08:56 -05:00
|
|
|
|
[AutoNetworkedField]
|
2022-07-14 19:45:27 -07:00
|
|
|
|
public int? Count = null;
|
|
|
|
|
|
}
|