1
0

ListingCondition.cs 922 B

1234567891011121314151617181920212223
  1. using JetBrains.Annotations;
  2. using Robust.Shared.Serialization;
  3. namespace Content.Shared.Store;
  4. /// <summary>
  5. /// Used to define a complicated condition that requires C#
  6. /// </summary>
  7. [ImplicitDataDefinitionForInheritors]
  8. [MeansImplicitUse]
  9. public abstract partial class ListingCondition
  10. {
  11. /// <summary>
  12. /// Determines whether or not a certain entity can purchase a listing.
  13. /// </summary>
  14. /// <returns>Whether or not the listing can be purchased</returns>
  15. public abstract bool Condition(ListingConditionArgs args);
  16. }
  17. /// <param name="Buyer">Either the account owner, user, or an inanimate object (e.g., surplus bundle)</param>
  18. /// <param name="Listing">The listing itself</param>
  19. /// <param name="EntityManager">An entitymanager for sane coding</param>
  20. public readonly record struct ListingConditionArgs(EntityUid Buyer, EntityUid? StoreEntity, ListingData Listing, IEntityManager EntityManager);