Add cargo shuttle (#8686)
This commit is contained in:
94
Content.Shared/Cargo/Prototypes/CargoProductPrototype.cs
Normal file
94
Content.Shared/Cargo/Prototypes/CargoProductPrototype.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Cargo.Prototypes
|
||||
{
|
||||
[NetSerializable, Serializable, Prototype("cargoProduct")]
|
||||
public sealed class CargoProductPrototype : IPrototype
|
||||
{
|
||||
[DataField("name")] private string _name = string.Empty;
|
||||
|
||||
[DataField("description")] private string _description = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Product name.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_name.Trim().Length != 0)
|
||||
return _name;
|
||||
|
||||
if (IoCManager.Resolve<IPrototypeManager>().TryIndex(Product, out EntityPrototype? prototype))
|
||||
{
|
||||
_name = prototype.Name;
|
||||
}
|
||||
|
||||
return _name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Short description of the product.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_description.Trim().Length != 0)
|
||||
return _description;
|
||||
|
||||
if (IoCManager.Resolve<IPrototypeManager>().TryIndex(Product, out EntityPrototype? prototype))
|
||||
{
|
||||
_description = prototype.Description;
|
||||
}
|
||||
|
||||
return _description;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Texture path used in the CargoConsole GUI.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("icon")]
|
||||
public SpriteSpecifier Icon { get; } = SpriteSpecifier.Invalid;
|
||||
|
||||
/// <summary>
|
||||
/// The prototype name of the product.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("product", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string Product { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The point cost of the product.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("cost")]
|
||||
public int PointCost { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The prototype category of the product. (e.g. Engineering, Medical)
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("category")]
|
||||
public string Category { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The prototype group of the product. (e.g. Contraband)
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("group")]
|
||||
public string Group { get; } = string.Empty;
|
||||
}
|
||||
}
|
||||
20
Content.Shared/Cargo/Prototypes/CargoShuttlePrototype.cs
Normal file
20
Content.Shared/Cargo/Prototypes/CargoShuttlePrototype.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Content.Shared.Dataset;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Cargo.Prototypes;
|
||||
|
||||
[Prototype("cargoShuttle")]
|
||||
public sealed class CargoShuttlePrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[ViewVariables, DataField("path")]
|
||||
public ResourcePath Path = default!;
|
||||
|
||||
[ViewVariables, DataField("nameDataset", customTypeSerializer:typeof(PrototypeIdSerializer<DatasetPrototype>))]
|
||||
public string NameDataset = "CargoShuttleNames";
|
||||
}
|
||||
Reference in New Issue
Block a user