Convert materials to use PhysicalComposition (#15414)

This commit is contained in:
Nemanja
2023-04-29 00:53:41 -04:00
committed by GitHub
parent 04abec9a55
commit dfc5bcdc12
13 changed files with 118 additions and 81 deletions

View File

@@ -1,16 +1,13 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
namespace Content.Shared.Materials
namespace Content.Shared.Materials;
/// <summary>
/// Empty component that marks an entity as a "raw" material.
/// The material amounts themselves are in <see cref="PhysicalCompositionComponent"/>
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class MaterialComponent : Component
{
/// <summary>
/// Component to store data such as "this object is made out of steel".
/// This is not a storage system for say smelteries.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class MaterialComponent : Component
{
[DataField("materials", customTypeSerializer:typeof(PrototypeIdDictionarySerializer<int, MaterialPrototype>))]
public readonly Dictionary<string, int> Materials = new();
}
}