2023-07-31 14:42:38 -04:00
|
|
|
|
using Content.Shared.Materials;
|
2023-08-25 20:40:42 +02:00
|
|
|
|
using Content.Shared.Power.Generator;
|
2023-07-31 14:42:38 -04:00
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Power.Generator;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-08-25 20:40:42 +02:00
|
|
|
|
/// Fuels a <see cref="FuelGeneratorComponent"/> through solid materials.
|
2023-07-31 14:42:38 -04:00
|
|
|
|
/// </summary>
|
2023-08-25 20:40:42 +02:00
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// <para>
|
|
|
|
|
|
/// Must be accompanied with a <see cref="MaterialStorageComponent"/> to store the actual material and handle insertion logic.
|
|
|
|
|
|
/// You should set a whitelist there for the fuel material.
|
|
|
|
|
|
/// </para>
|
|
|
|
|
|
/// <para>
|
|
|
|
|
|
/// The component itself stores a "fractional" fuel value to allow stack materials to be gradually consumed.
|
|
|
|
|
|
/// </para>
|
|
|
|
|
|
/// </remarks>
|
2023-07-31 14:42:38 -04:00
|
|
|
|
[RegisterComponent, Access(typeof(GeneratorSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class SolidFuelGeneratorAdapterComponent : Component
|
2023-07-31 14:42:38 -04:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The material to accept as fuel.
|
|
|
|
|
|
/// </summary>
|
2023-08-25 20:40:42 +02:00
|
|
|
|
[DataField("fuelMaterial", customTypeSerializer: typeof(PrototypeIdSerializer<MaterialPrototype>))]
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-07-31 14:42:38 -04:00
|
|
|
|
public string FuelMaterial = "Plasma";
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-08-25 20:40:42 +02:00
|
|
|
|
/// How much material (can be fractional) is left in the generator.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("fractionalMaterial"), ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
public float FractionalMaterial;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Value to multiply material amount by to get fuel amount.
|
2023-07-31 14:42:38 -04:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("multiplier"), ViewVariables(VVAccess.ReadWrite)]
|
2023-08-25 20:40:42 +02:00
|
|
|
|
public float Multiplier;
|
2023-07-31 14:42:38 -04:00
|
|
|
|
}
|