Remove buyer from store messages (#11230)

This commit is contained in:
Leon Friedrich
2022-09-14 19:04:41 +12:00
committed by GitHub
parent f78d709933
commit e955699c0f
6 changed files with 39 additions and 53 deletions

View File

@@ -17,7 +17,7 @@ public abstract class ListingCondition
public abstract bool Condition(ListingConditionArgs args);
}
/// <param name="Buyer">The person purchasing the listing</param>
/// <param name="Listing">The liting itself</param>
/// <param name="Buyer">Either the account owner, user, or an inanimate object (e.g., surplus bundle)</param>
/// <param name="Listing">The listing itself</param>
/// <param name="EntityManager">An entitymanager for sane coding</param>
public readonly record struct ListingConditionArgs(EntityUid Buyer, EntityUid? StoreEntity, ListingData Listing, IEntityManager EntityManager);

View File

@@ -1,5 +1,4 @@
using Content.Shared.FixedPoint;
using Content.Shared.MobState;
using Robust.Shared.Serialization;
namespace Content.Shared.Store;
@@ -13,15 +12,12 @@ public enum StoreUiKey : byte
[Serializable, NetSerializable]
public sealed class StoreUpdateState : BoundUserInterfaceState
{
public readonly EntityUid? Buyer;
public readonly HashSet<ListingData> Listings;
public readonly Dictionary<string, FixedPoint2> Balance;
public StoreUpdateState(EntityUid? buyer, HashSet<ListingData> listings, Dictionary<string, FixedPoint2> balance)
public StoreUpdateState(HashSet<ListingData> listings, Dictionary<string, FixedPoint2> balance)
{
Buyer = buyer;
Listings = listings;
Balance = balance;
}
@@ -44,24 +40,18 @@ public sealed class StoreInitializeState : BoundUserInterfaceState
[Serializable, NetSerializable]
public sealed class StoreRequestUpdateInterfaceMessage : BoundUserInterfaceMessage
{
public EntityUid CurrentBuyer;
public StoreRequestUpdateInterfaceMessage(EntityUid currentBuyer)
public StoreRequestUpdateInterfaceMessage()
{
CurrentBuyer = currentBuyer;
}
}
[Serializable, NetSerializable]
public sealed class StoreBuyListingMessage : BoundUserInterfaceMessage
{
public EntityUid Buyer;
public ListingData Listing;
public StoreBuyListingMessage(EntityUid buyer, ListingData listing)
public StoreBuyListingMessage(ListingData listing)
{
Buyer = buyer;
Listing = listing;
}
}
@@ -69,15 +59,12 @@ public sealed class StoreBuyListingMessage : BoundUserInterfaceMessage
[Serializable, NetSerializable]
public sealed class StoreRequestWithdrawMessage : BoundUserInterfaceMessage
{
public EntityUid Buyer;
public string Currency;
public int Amount;
public StoreRequestWithdrawMessage(EntityUid buyer, string currency, int amount)
public StoreRequestWithdrawMessage(string currency, int amount)
{
Buyer = buyer;
Currency = currency;
Amount = amount;
}