| 12345678910111213141516171819202122232425262728293031 |
- 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}";
- }
- }
|