2023-12-29 04:47:43 -08:00
|
|
|
|
using Content.Shared.Chemistry.Components;
|
|
|
|
|
|
using Content.Shared.Chemistry.Components.SolutionManager;
|
2023-08-25 20:40:42 +02:00
|
|
|
|
using Content.Shared.Chemistry.Reagent;
|
|
|
|
|
|
using Content.Shared.FixedPoint;
|
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2023-07-31 14:42:38 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Power.Generator;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This is used for chemical fuel input into generators.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[RegisterComponent, Access(typeof(GeneratorSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class ChemicalFuelGeneratorAdapterComponent : Component
|
2023-07-31 14:42:38 -04:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2023-08-25 20:40:42 +02:00
|
|
|
|
/// The reagent to accept as fuel.
|
2023-07-31 14:42:38 -04:00
|
|
|
|
/// </summary>
|
2023-08-25 20:40:42 +02:00
|
|
|
|
[DataField("reagent", customTypeSerializer: typeof(PrototypeIdSerializer<ReagentPrototype>))]
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
public string Reagent = "WeldingFuel";
|
2023-07-31 14:42:38 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-12-29 04:47:43 -08:00
|
|
|
|
/// The name of <see cref="Solution"/>.
|
2023-07-31 14:42:38 -04:00
|
|
|
|
/// </summary>
|
2023-08-25 20:40:42 +02:00
|
|
|
|
[DataField("solution")]
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-12-29 04:47:43 -08:00
|
|
|
|
public string SolutionName = "tank";
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The solution on the <see cref="SolutionContainerManagerComponent"/> to use.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("solutionRef")]
|
|
|
|
|
|
public Entity<SolutionComponent>? Solution = null;
|
2023-08-25 20:40:42 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Value to multiply reagent amount by to get fuel amount.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("multiplier"), ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
public float Multiplier = 1f;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// How much reagent (can be fractional) is left in the generator.
|
|
|
|
|
|
/// Stored in units of <see cref="FixedPoint2.Epsilon"/>.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("fractionalReagent"), ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
public float FractionalReagent;
|
2023-07-31 14:42:38 -04:00
|
|
|
|
}
|