Validate Cargo Markets (#37271)

* Validate cargo markets

* readonly market ID
This commit is contained in:
Nemanja
2025-05-08 15:53:19 -04:00
committed by GitHub
parent 4660f9938f
commit 7bec148634
4 changed files with 18 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ public sealed partial class CargoOrderConsoleComponent : Component
/// All of the <see cref="CargoProductPrototype.Group"/>s that are supported.
/// </summary>
[DataField, AutoNetworkedField]
public List<string> AllowedGroups = new() { "market" };
public List<ProtoId<CargoMarketPrototype>> AllowedGroups = new() { "market" };
/// <summary>
/// Access needed to toggle the limit on this console.

View File

@@ -0,0 +1,14 @@
using Robust.Shared.Prototypes;
namespace Content.Shared.Cargo.Prototypes;
/// <summary>
/// Defines a "market" that a cargo computer can access and make orders from.
/// </summary>
[Prototype]
public sealed partial class CargoMarketPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
public string ID { get; private set; } = default!;
}

View File

@@ -93,6 +93,6 @@ namespace Content.Shared.Cargo.Prototypes
/// The prototype group of the product. (e.g. Contraband)
/// </summary>
[DataField]
public string Group { get; private set; } = "market";
public ProtoId<CargoMarketPrototype> Group { get; private set; } = "market";
}
}

View File

@@ -0,0 +1,2 @@
- type: cargoMarket
id: market