Fix lathe unanchor interaction & general cleanup (#10156)

This commit is contained in:
Leon Friedrich
2022-08-04 12:38:56 +12:00
committed by GitHub
parent e98f728b7c
commit bbd6482420
5 changed files with 144 additions and 154 deletions

View File

@@ -29,13 +29,10 @@ namespace Content.Server.Lathe.Components
/// <summary>
/// The lathe's construction queue
/// </summary>
[ViewVariables]
public Queue<LatheRecipePrototype> Queue { get; } = new();
/// <summary>
/// The recipe the lathe is currently producing
/// </summary>
[ViewVariables]
public LatheRecipePrototype? ProducingRecipe;
[DataField("queue", customTypeSerializer: typeof(PrototypeIdListSerializer<LatheRecipePrototype>))]
public List<string> Queue { get; } = new();
// TODO queue serializer.
/// <summary>
/// How long the inserting animation will play
/// </summary>
@@ -46,12 +43,6 @@ namespace Content.Server.Lathe.Components
/// </suummary>
[DataField("insertionAccumulator")]
public float InsertionAccumulator = 0f;
/// <summary>
/// Production accumulator for the production time.
/// </summary>
[ViewVariables]
[DataField("producingAccumulator")]
public float ProducingAccumulator = 0f;
/// <summary>
/// The sound that plays when the lathe is producing an item, if any

View File

@@ -5,5 +5,11 @@ namespace Content.Server.Lathe.Components
/// <summary>
[RegisterComponent]
public sealed class LatheInsertingComponent : Component
{}
{
/// <summary>
/// Remaining insertion time, in seconds.
/// </summary>
[DataField("timeRemaining", required: true)]
public float TimeRemaining;
}
}

View File

@@ -1,3 +1,6 @@
using Content.Shared.Research.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Lathe.Components
{
/// <summary>
@@ -5,5 +8,17 @@ namespace Content.Server.Lathe.Components
/// <summary>
[RegisterComponent]
public sealed class LatheProducingComponent : Component
{}
{
/// <summary>
/// The recipe the lathe is currently producing
/// </summary>
[DataField("recipe", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<LatheRecipePrototype>))]
public string? Recipe;
/// <summary>
/// Remaining production time, in seconds.
/// </summary>
[DataField("timeRemaining", required: true)]
public float TimeRemaining;
}
}