Files
tbd-station-14/Content.Shared/Cargo/CargoBountyData.cs
Nemanja 4662d463b8 Chill bounties + fixes (#23411)
* Chill bounties + fixes

* localize

* fix arbitage
2024-01-03 17:34:47 -07:00

32 lines
953 B
C#

using Robust.Shared.Serialization;
using Content.Shared.Cargo.Prototypes;
using Robust.Shared.Prototypes;
namespace Content.Shared.Cargo;
/// <summary>
/// A data structure for storing currently available bounties.
/// </summary>
[DataDefinition, NetSerializable, Serializable]
public readonly partial record struct CargoBountyData
{
/// <summary>
/// A unique id used to identify the bounty
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public string Id { get; init; } = string.Empty;
/// <summary>
/// The prototype containing information about the bounty.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true)]
public ProtoId<CargoBountyPrototype> Bounty { get; init; } = string.Empty;
public CargoBountyData(CargoBountyPrototype bounty, int uniqueIdentifier)
{
Bounty = bounty.ID;
Id = $"{bounty.IdPrefix}{uniqueIdentifier:D3}";
}
}