Static shop catalogue for the F4 menu. Holds the list of stocked item ids and resolves them to ItemDefinition through Items.Get, with the host looking up prices from the catalogue.
namespace HorizonRP;
/// <summary>
/// La boutique du menu F4 vend des objets d'inventaire. Le prix vit dans le
/// catalogue (Items.cs) et n'est jamais lu depuis la requête du client : il
/// demande un Id, l'hôte retrouve le prix.
/// </summary>
public static class Shop
{
/// <summary>Ce que vend la supérette (l'ordre est celui du menu).</summary>
public static readonly IReadOnlyList<string> Stock = new List<string>
{
"pain", "sandwich", "hotdog", "glace", "soda", "cafe", "bandage", "trousse", "journal", "carton", "pied_de_biche",
};
public static IEnumerable<ItemDefinition> All => Stock.Select( Items.Get ).Where( x => x is not null );
public static ItemDefinition Get( string id ) => Stock.Contains( id ) ? Items.Get( id ) : null;
}