Files
tbd-station-14/Content.Shared/Maps/ContentTileDefinition.cs
moonheart08 86e2f2005e Allows placing cables on lattices. (#4984)
Adds a "sturdy" tile flag, that in the future could be used by construction/etc to figure out if it's safe to build on a tile. (For example water isn't space, but it's not a sturdy building surface!)
2021-10-23 17:32:33 -07:00

53 lines
1.8 KiB
C#

using Content.Shared.Sound;
using JetBrains.Annotations;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables;
using System.Collections.Generic;
namespace Content.Shared.Maps
{
[UsedImplicitly]
[Prototype("tile")]
public sealed class ContentTileDefinition : IPrototype, ITileDefinition
{
[ViewVariables]
string IPrototype.ID => Name;
public string Path => "/Textures/Tiles/";
[DataField("name", required: true)] public string Name { get; } = string.Empty;
public ushort TileId { get; private set; }
[DataField("display_name")] public string DisplayName { get; } = string.Empty;
[DataField("texture")] public string SpriteName { get; } = string.Empty;
[DataField("is_subfloor")] public bool IsSubFloor { get; private set; }
[DataField("base_turfs")] public List<string> BaseTurfs { get; } = new();
[DataField("can_crowbar")] public bool CanCrowbar { get; private set; }
[DataField("footstep_sounds", required: true)] public SoundSpecifier FootstepSounds { get; } = default!;
[DataField("friction")] public float Friction { get; set; }
[DataField("thermalConductivity")] public float ThermalConductivity { get; set; } = 0.05f;
[DataField("item_drop", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string ItemDropPrototypeName { get; } = "FloorTileItemSteel";
[DataField("is_space")] public bool IsSpace { get; private set; }
[DataField("sturdy")] public bool Sturdy { get; private set; } = true;
public void AssignTileId(ushort id)
{
TileId = id;
}
}
}