using Content.Shared.Construction.Prototypes;
using Content.Shared.Research.Prototypes;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Lathe
{
[RegisterComponent, NetworkedComponent]
public sealed class LatheComponent : Component
{
///
/// All of the recipes that the lathe has by default
///
[DataField("staticRecipes", customTypeSerializer: typeof(PrototypeIdListSerializer))]
public readonly List StaticRecipes = new();
///
/// All of the recipes that the lathe is capable of researching
///
[DataField("dynamicRecipes", customTypeSerializer: typeof(PrototypeIdListSerializer))]
public readonly List DynamicRecipes = new();
///
/// The lathe's construction queue
///
[DataField("queue")]
public List Queue = new();
///
/// The sound that plays when the lathe is producing an item, if any
///
[DataField("producingSound")]
public SoundSpecifier? ProducingSound;
#region Visualizer info
[DataField("idleState", required: true)]
public string IdleState = default!;
[DataField("runningState", required: true)]
public string RunningState = default!;
#endregion
///
/// The recipe the lathe is currently producing
///
[ViewVariables]
public LatheRecipePrototype? CurrentRecipe;
#region MachineUpgrading
///
/// A modifier that changes how long it takes to print a recipe
///
[ViewVariables(VVAccess.ReadWrite)]
public float TimeMultiplier = 1;
///
/// The machine part that reduces how long it takes to print a recipe.
///
[DataField("machinePartPrintSpeed", customTypeSerializer: typeof(PrototypeIdSerializer))]
public string MachinePartPrintTime = "Manipulator";
///
/// The value that is used to calculate the modified
///
[DataField("partRatingPrintTimeMultiplier")]
public float PartRatingPrintTimeMultiplier = 0.5f;
///
/// A modifier that changes how much of a material is needed to print a recipe
///
[ViewVariables(VVAccess.ReadWrite)]
public float MaterialUseMultiplier = 1;
///
/// The machine part that reduces how much material it takes to print a recipe.
///
[DataField("machinePartMaterialUse", customTypeSerializer: typeof(PrototypeIdSerializer))]
public string MachinePartMaterialUse = "MatterBin";
///
/// The value that is used to calculate the modifier
///
[DataField("partRatingMaterialUseMultiplier")]
public float PartRatingMaterialUseMultiplier = DefaultPartRatingMaterialUseMultiplier;
public const float DefaultPartRatingMaterialUseMultiplier = 0.85f;
#endregion
}
public sealed class LatheGetRecipesEvent : EntityEventArgs
{
public readonly EntityUid Lathe;
public List Recipes = new();
public LatheGetRecipesEvent(EntityUid lathe)
{
Lathe = lathe;
}
}
}