using Content.Shared.Atmos; using JetBrains.Annotations; using Robust.Shared.Audio; using Robust.Shared.Map; 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.Maps { [UsedImplicitly] [Prototype("tile")] public sealed class ContentTileDefinition : IPrototype, IInheritingPrototype, ITileDefinition { public const string SpaceID = "Space"; private string _name = string.Empty; [ParentDataFieldAttribute(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; private set; } [NeverPushInheritance] [AbstractDataFieldAttribute] public bool Abstract { get; private set; } [IdDataFieldAttribute] public string ID { get; } = string.Empty; public ushort TileId { get; private set; } [DataField("name")] public string Name { get; private set; } = ""; [DataField("sprite")] public ResourcePath? Sprite { get; } [DataField("isSubfloor")] public bool IsSubFloor { get; private set; } [DataField("baseTurfs")] public List BaseTurfs { get; } = new(); [DataField("canCrowbar")] public bool CanCrowbar { get; private set; } [DataField("canWirecutter")] public bool CanWirecutter { get; private set; } /// /// These play when the mob has shoes on. /// [DataField("footstepSounds")] public SoundSpecifier? FootstepSounds { get; } /// /// These play when the mob has no shoes on. /// [DataField("barestepSounds")] public SoundSpecifier? BarestepSounds { get; } = new SoundCollectionSpecifier("BarestepHard"); [DataField("friction")] public float Friction { get; set; } [DataField("variants")] public byte Variants { get; set; } = 1; /// /// This controls what variants the `variantize` command is allowed to use. /// [DataField("placementVariants")] public byte[] PlacementVariants { get; set; } = new byte[1] { 0 }; [DataField("thermalConductivity")] public float ThermalConductivity { get; set; } = 0.05f; // Heat capacity is opt-in, not opt-out. [DataField("heatCapacity")] public float HeatCapacity = Atmospherics.MinimumHeatCapacity; [DataField("itemDrop", customTypeSerializer:typeof(PrototypeIdSerializer))] public string ItemDropPrototypeName { get; } = "FloorTileItemSteel"; [DataField("isSpace")] public bool IsSpace { get; private set; } [DataField("sturdy")] public bool Sturdy { get; private set; } = true; /// /// Can weather affect this tile. /// [DataField("weather")] public bool Weather = false; public void AssignTileId(ushort id) { TileId = id; } } }