expedition rewards (#16972)
Co-authored-by: deltanedas <@deltanedas:kde.org> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -6,13 +6,18 @@ namespace Content.Shared.Cargo
|
||||
[NetSerializable, Serializable]
|
||||
public sealed class CargoOrderData
|
||||
{
|
||||
/// <summary>
|
||||
/// Price when the order was added.
|
||||
/// </summary>
|
||||
public int Price;
|
||||
|
||||
/// <summary>
|
||||
/// A unique (arbitrary) ID which identifies this order.
|
||||
/// </summary>
|
||||
public readonly int OrderId;
|
||||
|
||||
/// <summary>
|
||||
/// Prototype id for the item to create
|
||||
/// Prototype Id for the item to be created
|
||||
/// </summary>
|
||||
public readonly string ProductId;
|
||||
|
||||
@@ -24,7 +29,7 @@ namespace Content.Shared.Cargo
|
||||
|
||||
/// <summary>
|
||||
/// How many instances of this order that we've already dispatched
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public int NumDispatched = 0;
|
||||
|
||||
public readonly string Requester;
|
||||
@@ -34,25 +39,26 @@ namespace Content.Shared.Cargo
|
||||
public bool Approved => Approver is not null;
|
||||
public string? Approver;
|
||||
|
||||
public CargoOrderData(int orderId, string productId, int amount, string requester, string reason)
|
||||
public CargoOrderData(int orderId, string productId, int price, int amount, string requester, string reason)
|
||||
{
|
||||
OrderId = orderId;
|
||||
ProductId = productId;
|
||||
Price = price;
|
||||
OrderQuantity = amount;
|
||||
Requester = requester;
|
||||
Reason = reason;
|
||||
}
|
||||
|
||||
public void SetApproverData(IdCardComponent? idCard)
|
||||
public void SetApproverData(string? fullName, string? jobTitle)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
if (!string.IsNullOrWhiteSpace(idCard?.FullName))
|
||||
if (!string.IsNullOrWhiteSpace(fullName))
|
||||
{
|
||||
sb.Append($"{idCard.FullName} ");
|
||||
sb.Append($"{fullName} ");
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(idCard?.JobTitle))
|
||||
if (!string.IsNullOrWhiteSpace(jobTitle))
|
||||
{
|
||||
sb.Append($"({idCard.JobTitle})");
|
||||
sb.Append($"({jobTitle})");
|
||||
}
|
||||
Approver = sb.ToString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user