2023-01-16 11:53:23 -05:00
|
|
|
|
using Content.Shared.Construction.Components;
|
|
|
|
|
|
using Content.Shared.Construction.Prototypes;
|
2020-12-03 22:49:00 +01:00
|
|
|
|
using Robust.Shared.Containers;
|
2022-09-26 16:18:31 -04:00
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Server.Construction.Components
|
2020-12-03 22:49:00 +01:00
|
|
|
|
{
|
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class MachineFrameComponent : Component
|
2020-12-03 22:49:00 +01:00
|
|
|
|
{
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public const string PartContainerName = "machine_parts";
|
|
|
|
|
|
public const string BoardContainerName = "machine_board";
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public bool HasBoard => BoardContainer?.ContainedEntities.Count != 0;
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
2022-11-16 20:22:11 +01:00
|
|
|
|
[DataField("progress", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, MachinePartPrototype>))]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public Dictionary<string, int> Progress = new();
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public readonly Dictionary<string, int> MaterialProgress = new();
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public readonly Dictionary<string, int> ComponentProgress = new();
|
2021-03-08 05:09:30 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public readonly Dictionary<string, int> TagProgress = new();
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
2022-11-16 20:22:11 +01:00
|
|
|
|
[DataField("requirements", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, MachinePartPrototype>))]
|
2022-09-26 16:18:31 -04:00
|
|
|
|
public Dictionary<string, int> Requirements = new();
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public Dictionary<string, int> MaterialRequirements = new();
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public Dictionary<string, GenericPartInfo> ComponentRequirements = new();
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public Dictionary<string, GenericPartInfo> TagRequirements = new();
|
2020-12-03 22:49:00 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public Container BoardContainer = default!;
|
2021-03-08 05:09:30 +01:00
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-07-14 04:35:37 -07:00
|
|
|
|
public Container PartContainer = default!;
|
2020-12-03 22:49:00 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|