using Content.Shared.Whitelist;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Materials;
///
/// This is a machine that handles converting entities
/// into the raw materials and chemicals that make them up.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
[Access(typeof(SharedMaterialReclaimerSystem))]
public sealed partial class MaterialReclaimerComponent : Component
{
///
/// Whether or not the machine has power. We put it here
/// so we can network and predict it.
///
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public bool Powered;
///
/// An "enable" toggle for things like interfacing with machine linking
///
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public bool Enabled = true;
///
/// A master control for whether or not the recycler is broken and can function.
///
[DataField, AutoNetworkedField]
public bool Broken;
///
/// How efficiently the materials are reclaimed.
/// In practice, a multiplier per material when calculating the output of the reclaimer.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float Efficiency = 1f;
///
/// Whether or not the process
/// speed scales with the amount of materials being processed
/// or if it's just
///
[DataField]
public bool ScaleProcessSpeed = true;
///
/// How quickly it takes to consume X amount of materials per second.
/// For example, with a rate of 50, an entity with 100 total material takes 2 seconds to process.
///
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public float MaterialProcessRate = 100f;
///
/// The minimum amount fo time it can take to process an entity.
/// this value supercedes the calculated one using
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public TimeSpan MinimumProcessDuration = TimeSpan.FromSeconds(0.5f);
///
/// The id of our output solution
///
[DataField]
public string? SolutionContainerId;
///
/// If the reclaimer should attempt to reclaim all solutions or just drainable ones
/// Difference between Recycler and Industrial Reagent Grinder
///
[DataField]
public bool OnlyReclaimDrainable = true;
///
/// a whitelist for what entities can be inserted into this reclaimer
///
[DataField]
public EntityWhitelist? Whitelist;
///
/// a blacklist for what entities cannot be inserted into this reclaimer
///
[DataField]
public EntityWhitelist? Blacklist;
///
/// The sound played when something is being processed.
///
[DataField]
public SoundSpecifier? Sound;
///
/// whether or not we cut off the sound early when the reclaiming ends.
///
[DataField]
public bool CutOffSound = true;
///
/// When the next sound will be allowed to be played. Used to prevent spam.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextSound;
///
/// Minimum time inbetween each
///
[DataField]
public TimeSpan SoundCooldown = TimeSpan.FromSeconds(0.8f);
public EntityUid? Stream;
///
/// A counter of how many items have been processed
///
///
/// I saw this on the recycler and i'm porting it because it's cute af
///
[DataField, AutoNetworkedField]
public int ItemsProcessed;
}
[NetSerializable, Serializable]
public enum RecyclerVisuals
{
Bloody,
Broken
}
[UsedImplicitly]
public enum RecyclerVisualLayers : byte
{
Main
}