Files
crystall-punk-14/Content.Shared/Materials/MaterialPrototype.cs

54 lines
1.8 KiB
C#
Raw Normal View History

using Robust.Shared.Prototypes;
2023-01-07 13:09:05 -05:00
using Robust.Shared.Utility;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
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]
2022-04-03 02:01:22 +02:00
[AbstractDataFieldAttribute]
public bool Abstract { get; } = false;
[ViewVariables]
[IdDataField]
public string ID { get; } = default!;
2023-01-07 13:09:05 -05:00
/// <summary>
/// For material storage to be able to convert back and forth
/// between the material and physical entities you can carry,
/// include which stack we should spawn by default.
/// </summary>
[DataField("stackEntity", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
2023-06-14 20:49:23 -04:00
public string? StackEntity;
[DataField("name")]
2023-01-07 13:09:05 -05:00
public string Name = "";
[DataField("color")]
public Color Color { get; } = Color.Gray;
/// <summary>
/// An icon used to represent the material in graphic interfaces.
/// </summary>
[DataField("icon")]
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
/// <summary>
/// The price per cm3.
/// </summary>
[DataField("price", required: true)]
public double Price = 0;
}
}