Improve lathe queue performance (#38583)

* Use an actual Queue

* Store ProtoIds instead of prototypes

* Network as NetListAsArray

* Remove Serializable & NetSerializable from LatheRecipePrototype

* Convert CurrentlyProducing too

* No point using NetListAsArray<T> if you're going to .ToArray() it anyways.

---------

Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
This commit is contained in:
Tayrtahn
2025-06-26 18:08:01 -04:00
committed by GitHub
parent cc2a89ed86
commit 3a8974f574
5 changed files with 25 additions and 19 deletions

View File

@@ -29,7 +29,7 @@ namespace Content.Shared.Lathe
/// The lathe's construction queue
/// </summary>
[DataField]
public List<LatheRecipePrototype> Queue = new();
public Queue<ProtoId<LatheRecipePrototype>> Queue = new();
/// <summary>
/// The sound that plays when the lathe is producing an item, if any
@@ -64,7 +64,7 @@ namespace Content.Shared.Lathe
/// The recipe the lathe is currently producing
/// </summary>
[ViewVariables]
public LatheRecipePrototype? CurrentRecipe;
public ProtoId<LatheRecipePrototype>? CurrentRecipe;
#region MachineUpgrading
/// <summary>