using Content.Shared.Kitchen.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Kitchen.Components;
///
/// The combo reagent grinder/juicer. The reason why grinding and juicing are seperate is simple,
/// think of grinding as a utility to break an object down into its reagents. Think of juicing as
/// converting something into its single juice form. E.g, grind an apple and get the nutriment and sugar
/// it contained, juice an apple and get "apple juice".
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(raiseAfterAutoHandleState: true), AutoGenerateComponentPause]
[Access(typeof(SharedReagentGrinderSystem))]
public sealed partial class ReagentGrinderComponent : Component
{
///
/// The container slot id for the beaker.
///
public const string BeakerSlotId = "beakerSlot";
///
/// The container id for the internal storage.
///
public const string InputContainerId = "inputContainer";
///
/// The cached container for the internal storage.
///
[ViewVariables]
public Container InputContainer = default!;
///
/// The amount of entities that fit into the container.
///
[DataField, AutoNetworkedField]
public int StorageMaxEntities = 6;
///
/// The time grinding or juicing takes.
/// Roughly matches the grind/juice sounds.
///
[DataField]
public TimeSpan WorkTime = TimeSpan.FromSeconds(3.5f);
///
/// Multiplier for WorkTime, that pitches the audio accordingly.
///
[DataField, AutoNetworkedField]
public float WorkTimeMultiplier = 1.0f;
///
/// Sound played when pressing a button on the UI.
///
[DataField]
public SoundSpecifier ClickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg", AudioParams.Default.WithVolume(-2f));
///
/// Sound played when grinding.
///
[DataField]
public SoundSpecifier GrindSound = new SoundPathSpecifier("/Audio/Machines/blender.ogg");
///
/// Sound played when juicing.
///
[DataField]
public SoundSpecifier JuiceSound = new SoundPathSpecifier("/Audio/Machines/juicer.ogg");
///
/// Grind automatically when inserting items?
///
[DataField, AutoNetworkedField]
public GrinderAutoMode AutoMode = GrinderAutoMode.Off;
///
/// The sound currently being played.
///
[DataField]
public EntityUid? AudioStream;
///
/// The time the grinder will finish grinding/juicing.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoNetworkedField, AutoPausedField]
public TimeSpan? EndTime;
///
/// The currently active program (if the grinder is working).
///
[DataField, AutoNetworkedField]
public GrinderProgram? Program;
}
///
/// Marker component for active reagent grinders used to improve the EntityQueryEnumerator performance in the update loop.
/// If you want to check if the grinder is currently active use instead,
/// because this component is being removed deferred, i.e. in the following game tick.
///
[RegisterComponent, NetworkedComponent]
public sealed partial class ActiveReagentGrinderComponent : Component;
///
/// Marker component added to beakers inserted into a reagent grinder.
/// Used to update the UI when the solution in the beaker changes.
///
[RegisterComponent, NetworkedComponent]
public sealed partial class InsideReagentGrinderComponent : Component;