2021-05-20 10:37:34 +02:00
|
|
|
using Robust.Shared.Prototypes;
|
2023-01-07 13:09:05 -05:00
|
|
|
using Robust.Shared.Utility;
|
2021-05-20 10:37:34 +02:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2022-08-01 14:39:37 +02:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
|
2021-05-20 10:37:34 +02:00
|
|
|
|
|
|
|
|
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")]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class MaterialPrototype : IPrototype, IInheritingPrototype
|
2021-05-20 10:37:34 +02:00
|
|
|
{
|
|
|
|
|
[ViewVariables]
|
2022-08-01 14:39:37 +02:00
|
|
|
[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<MaterialPrototype>))]
|
|
|
|
|
public string[]? Parents { get; }
|
2021-05-20 10:37:34 +02:00
|
|
|
|
|
|
|
|
[ViewVariables]
|
2022-04-03 02:01:22 +02:00
|
|
|
[AbstractDataFieldAttribute]
|
2021-05-20 10:37:34 +02:00
|
|
|
public bool Abstract { get; } = false;
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2023-01-19 03:56:45 +01:00
|
|
|
[IdDataField]
|
2021-05-20 10:37:34 +02:00
|
|
|
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;
|
2021-05-20 10:37:34 +02:00
|
|
|
|
|
|
|
|
[DataField("name")]
|
2023-01-07 13:09:05 -05:00
|
|
|
public string Name = "";
|
2021-05-20 10:37:34 +02:00
|
|
|
|
|
|
|
|
[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;
|
2022-06-03 10:56:11 -05:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The price per cm3.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("price", required: true)]
|
|
|
|
|
public double Price = 0;
|
2021-05-20 10:37:34 +02:00
|
|
|
}
|
|
|
|
|
}
|