Portable Generator Rework (#19302)

This commit is contained in:
Pieter-Jan Briers
2023-08-25 20:40:42 +02:00
committed by GitHub
parent 50828363fe
commit bf16698efa
73 changed files with 1933 additions and 473 deletions

View File

@@ -1,6 +1,7 @@
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Whitelist;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
using Content.Server.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Power.Generator;
@@ -11,14 +12,29 @@ namespace Content.Server.Power.Generator;
public sealed partial class ChemicalFuelGeneratorAdapterComponent : Component
{
/// <summary>
/// The acceptable list of input entities.
/// The reagent to accept as fuel.
/// </summary>
[DataField("whitelist")]
public EntityWhitelist? Whitelist;
[DataField("reagent", customTypeSerializer: typeof(PrototypeIdSerializer<ReagentPrototype>))]
[ViewVariables(VVAccess.ReadWrite)]
public string Reagent = "WeldingFuel";
/// <summary>
/// The conversion factor for different chems you can put in.
/// The solution on the <see cref="SolutionContainerManagerComponent"/> to use.
/// </summary>
[DataField("chemConversionFactors", required: true, customTypeSerializer:typeof(PrototypeIdDictionarySerializer<float, ReagentPrototype>))]
public Dictionary<string, float> ChemConversionFactors = default!;
[DataField("solution")]
[ViewVariables(VVAccess.ReadWrite)]
public string Solution = "tank";
/// <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;
}