using Content.Shared.Construction.Prototypes; using Content.Shared.Lathe.Prototypes; using Content.Shared.Research.Prototypes; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; namespace Content.Shared.Lathe { [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class LatheComponent : Component { /// /// All of the recipe packs that the lathe has by default /// [DataField] public List> StaticPacks = new(); /// /// All of the recipe packs that the lathe is capable of researching /// [DataField] public List> DynamicPacks = new(); // Note that this shouldn't be modified dynamically. // I.e., this + the static recipies should represent all recipies that the lathe can ever make // Otherwise the material arbitrage test and/or LatheSystem.GetAllBaseRecipes needs to be updated /// /// The lathe's construction queue. /// /// /// This is a LinkedList to allow for constant time insertion/deletion (vs a List), and more efficient /// moves (vs a Queue). /// [DataField] public LinkedList Queue = new(); /// /// The sound that plays when the lathe is producing an item, if any /// [DataField] public SoundSpecifier? ProducingSound; [DataField] public string? ReagentOutputSlotId; /// /// The default amount that's displayed in the UI for selecting the print amount. /// [DataField, AutoNetworkedField] public int DefaultProductionAmount = 1; #region Visualizer info [DataField] public string? IdleState; [DataField] public string? RunningState; [DataField] public string? UnlitIdleState; [DataField] public string? UnlitRunningState; #endregion /// /// The recipe the lathe is currently producing /// [ViewVariables] public ProtoId? CurrentRecipe; #region MachineUpgrading /// /// A modifier that changes how long it takes to print a recipe /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float TimeMultiplier = 1; /// /// A modifier that changes how much of a material is needed to print a recipe /// [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public float MaterialUseMultiplier = 1; #endregion } public sealed class LatheGetRecipesEvent : EntityEventArgs { public readonly EntityUid Lathe; public readonly LatheComponent Comp; public bool GetUnavailable; public HashSet> Recipes = new(); public LatheGetRecipesEvent(Entity lathe, bool forced) { (Lathe, Comp) = lathe; GetUnavailable = forced; } } [Serializable] public sealed partial class LatheRecipeBatch { public ProtoId Recipe; public int ItemsPrinted; public int ItemsRequested; public LatheRecipeBatch(ProtoId recipe, int itemsPrinted, int itemsRequested) { Recipe = recipe; ItemsPrinted = itemsPrinted; ItemsRequested = itemsRequested; } } /// /// Event raised on a lathe when it starts producing a recipe. /// [ByRefEvent] public readonly record struct LatheStartPrintingEvent(LatheRecipePrototype Recipe); }