Files
tbd-station-14/Content.Shared/Materials/MaterialPrototype.cs
Paul Ritter f77aff7b94 prototype composition (#9979) & updates submodule
* prototype composition

* a

* fixes build

* fixes test

* updates submodule

Co-authored-by: Paul Ritter <ritter.paul1@gmail.com>
2022-08-01 14:39:37 +02:00

54 lines
1.7 KiB
C#

using Content.Shared.Stacks;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
using Robust.Shared.Utility;
namespace Content.Shared.Materials
{
/// <summary>
/// Materials are read-only storage for the properties of specific materials.
/// Properties should be intrinsic (or at least as much is necessary for game purposes).
/// </summary>
[Prototype("material")]
public sealed class MaterialPrototype : IPrototype, IInheritingPrototype
{
[ViewVariables]
[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<MaterialPrototype>))]
public string[]? Parents { get; }
[ViewVariables]
[AbstractDataFieldAttribute]
public bool Abstract { get; } = false;
[ViewVariables]
[IdDataFieldAttribute]
public string ID { get; } = default!;
[ViewVariables]
[DataField("stack", customTypeSerializer:typeof(PrototypeIdSerializer<StackPrototype>))]
public string? StackId { get; } = null;
[ViewVariables]
[DataField("name")]
public string Name { get; } = "unobtanium";
[ViewVariables]
[DataField("color")]
public Color Color { get; } = Color.Gray;
/// <summary>
/// An icon used to represent the material in graphic interfaces.
/// </summary>
[ViewVariables]
[DataField("icon")]
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
/// <summary>
/// The price per cm3.
/// </summary>
[DataField("price", required: true)]
public double Price = 0;
}
}