SolidFuelGeneratorAdapterComponent.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Content.Shared.Materials;
  2. using Content.Shared.Power.Generator;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  4. namespace Content.Server.Power.Generator;
  5. /// <summary>
  6. /// Fuels a <see cref="FuelGeneratorComponent"/> through solid materials.
  7. /// </summary>
  8. /// <remarks>
  9. /// <para>
  10. /// Must be accompanied with a <see cref="MaterialStorageComponent"/> to store the actual material and handle insertion logic.
  11. /// You should set a whitelist there for the fuel material.
  12. /// </para>
  13. /// <para>
  14. /// The component itself stores a "fractional" fuel value to allow stack materials to be gradually consumed.
  15. /// </para>
  16. /// </remarks>
  17. [RegisterComponent, Access(typeof(GeneratorSystem))]
  18. public sealed partial class SolidFuelGeneratorAdapterComponent : Component
  19. {
  20. /// <summary>
  21. /// The material to accept as fuel.
  22. /// </summary>
  23. [DataField("fuelMaterial", customTypeSerializer: typeof(PrototypeIdSerializer<MaterialPrototype>))]
  24. [ViewVariables(VVAccess.ReadWrite)]
  25. public string FuelMaterial = "Plasma";
  26. /// <summary>
  27. /// How much material (can be fractional) is left in the generator.
  28. /// </summary>
  29. [DataField("fractionalMaterial"), ViewVariables(VVAccess.ReadWrite)]
  30. public float FractionalMaterial;
  31. /// <summary>
  32. /// Value to multiply material amount by to get fuel amount.
  33. /// </summary>
  34. [DataField("multiplier"), ViewVariables(VVAccess.ReadWrite)]
  35. public float Multiplier;
  36. }