2021-02-27 04:12:09 +01:00
|
|
|
|
#nullable enable
|
|
|
|
|
|
using System.Collections.Generic;
|
2019-04-15 21:11:38 -06:00
|
|
|
|
using Robust.Shared.Prototypes;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2019-04-15 21:11:38 -06:00
|
|
|
|
using Robust.Shared.Utility;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
using Robust.Shared.ViewVariables;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Construction
|
|
|
|
|
|
{
|
|
|
|
|
|
[Prototype("construction")]
|
2021-02-20 00:05:24 +01:00
|
|
|
|
public class ConstructionPrototype : IPrototype
|
2018-08-02 08:29:55 +02:00
|
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
|
[DataField("conditions")] private List<IConstructionCondition> _conditions = new();
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Friendly name displayed in the construction GUI.
|
|
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("name")]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public string Name { get; } = string.Empty;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// "Useful" description displayed in the construction GUI.
|
|
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("description")]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public string Description { get; } = string.Empty;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-10-08 17:41:23 +02:00
|
|
|
|
/// The <see cref="ConstructionGraphPrototype"/> this construction will be using.
|
2018-08-02 08:29:55 +02:00
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("graph")]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public string Graph { get; } = string.Empty;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
2020-03-06 13:15:44 -06:00
|
|
|
|
/// <summary>
|
2020-10-08 17:41:23 +02:00
|
|
|
|
/// The target <see cref="ConstructionGraphNode"/> this construction will guide the user to.
|
2020-03-06 13:15:44 -06:00
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("targetNode")]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public string TargetNode { get; } = string.Empty;
|
2020-03-06 13:15:44 -06:00
|
|
|
|
|
2018-08-02 08:29:55 +02:00
|
|
|
|
/// <summary>
|
2020-10-08 17:41:23 +02:00
|
|
|
|
/// The starting <see cref="ConstructionGraphNode"/> this construction will start at.
|
2018-08-02 08:29:55 +02:00
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("startNode")]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public string StartNode { get; } = string.Empty;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-10-08 17:41:23 +02:00
|
|
|
|
/// Texture path inside the construction GUI.
|
2018-08-02 08:29:55 +02:00
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("icon")]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-10-08 17:41:23 +02:00
|
|
|
|
/// If you can start building or complete steps on impassable terrain.
|
2018-08-02 08:29:55 +02:00
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
|
[DataField("canBuildInImpassable")]
|
2020-10-08 17:41:23 +02:00
|
|
|
|
public bool CanBuildInImpassable { get; private set; }
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
|
[DataField("category")] public string Category { get; private set; } = string.Empty;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
|
[DataField("objectType")] public ConstructionType Type { get; private set; } = ConstructionType.Structure;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
|
[ViewVariables]
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("id", required: true)]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public string ID { get; } = default!;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("placementMode")]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public string PlacementMode { get; } = "PlaceFree";
|
2020-10-08 17:41:23 +02:00
|
|
|
|
|
2020-10-12 14:22:31 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether this construction can be constructed rotated or not.
|
|
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("canRotate")]
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public bool CanRotate { get; } = true;
|
2020-10-12 14:22:31 +02:00
|
|
|
|
|
2020-10-08 17:41:23 +02:00
|
|
|
|
public IReadOnlyList<IConstructionCondition> Conditions => _conditions;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public enum ConstructionType
|
|
|
|
|
|
{
|
|
|
|
|
|
Structure,
|
|
|
|
|
|
Item,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|