SolutionTransferComponent.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Content.Shared.FixedPoint;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Chemistry.Components;
  4. /// <summary>
  5. /// Gives click behavior for transferring to/from other reagent containers.
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  8. public sealed partial class SolutionTransferComponent : Component
  9. {
  10. /// <summary>
  11. /// The amount of solution to be transferred from this solution when clicking on other solutions with it.
  12. /// </summary>
  13. [DataField("transferAmount")]
  14. [ViewVariables(VVAccess.ReadWrite)]
  15. [AutoNetworkedField]
  16. public FixedPoint2 TransferAmount { get; set; } = FixedPoint2.New(5);
  17. /// <summary>
  18. /// The minimum amount of solution that can be transferred at once from this solution.
  19. /// </summary>
  20. [DataField("minTransferAmount")]
  21. [ViewVariables(VVAccess.ReadWrite)]
  22. public FixedPoint2 MinimumTransferAmount { get; set; } = FixedPoint2.New(5);
  23. /// <summary>
  24. /// The maximum amount of solution that can be transferred at once from this solution.
  25. /// </summary>
  26. [DataField("maxTransferAmount")]
  27. [ViewVariables(VVAccess.ReadWrite)]
  28. public FixedPoint2 MaximumTransferAmount { get; set; } = FixedPoint2.New(100);
  29. /// <summary>
  30. /// Can this entity take reagent from reagent tanks?
  31. /// </summary>
  32. [DataField("canReceive")]
  33. [ViewVariables(VVAccess.ReadWrite)]
  34. public bool CanReceive { get; set; } = true;
  35. /// <summary>
  36. /// Can this entity give reagent to other reagent containers?
  37. /// </summary>
  38. [DataField("canSend")]
  39. [ViewVariables(VVAccess.ReadWrite)]
  40. public bool CanSend { get; set; } = true;
  41. /// <summary>
  42. /// Whether you're allowed to change the transfer amount.
  43. /// </summary>
  44. [DataField("canChangeTransferAmount")]
  45. [ViewVariables(VVAccess.ReadWrite)]
  46. public bool CanChangeTransferAmount { get; set; } = false;
  47. }