1
0

ChemicalFuelGeneratorAdapterComponent.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Content.Shared.Chemistry.Components;
  2. using Content.Shared.Chemistry.Components.SolutionManager;
  3. using Content.Shared.Chemistry.Reagent;
  4. using Content.Shared.FixedPoint;
  5. using Robust.Shared.Prototypes;
  6. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  7. namespace Content.Server.Power.Generator;
  8. /// <summary>
  9. /// This is used for chemical fuel input into generators.
  10. /// </summary>
  11. [RegisterComponent, Access(typeof(GeneratorSystem))]
  12. public sealed partial class ChemicalFuelGeneratorAdapterComponent : Component
  13. {
  14. /// <summary>
  15. /// A dictionary relating a reagent to accept as fuel to a value to multiply reagent amount by to get fuel amount.
  16. /// </summary>
  17. [DataField]
  18. public Dictionary<ProtoId<ReagentPrototype>, float> Reagents = new();
  19. /// <summary>
  20. /// The name of <see cref="Solution"/>.
  21. /// </summary>
  22. [DataField("solution")]
  23. [ViewVariables(VVAccess.ReadWrite)]
  24. public string SolutionName = "tank";
  25. /// <summary>
  26. /// The solution on the <see cref="SolutionContainerManagerComponent"/> to use.
  27. /// </summary>
  28. [ViewVariables]
  29. public Entity<SolutionComponent>? Solution = null;
  30. /// <summary>
  31. /// How much reagent (can be fractional) is left in the generator.
  32. /// Stored in units of <see cref="FixedPoint2.Epsilon"/>.
  33. /// </summary>
  34. [DataField]
  35. public Dictionary<ProtoId<ReagentPrototype>, float> FractionalReagents = new();
  36. }