Enable nullability in Content.Server (#3685)

This commit is contained in:
DrSmugleaf
2021-03-16 15:50:20 +01:00
committed by GitHub
parent 90fec0ed24
commit a5ade526b7
306 changed files with 1616 additions and 1441 deletions

View File

@@ -22,27 +22,23 @@ namespace Content.Server.GameObjects.Components.Construction
[ViewVariables]
[DataField("requirements")]
private Dictionary<MachinePart, int> _requirements = new();
public readonly Dictionary<MachinePart, int> Requirements = new();
[ViewVariables]
[DataField("materialRequirements")]
private Dictionary<string, int> _materialIdRequirements = new();
public readonly Dictionary<string, int> MaterialIdRequirements = new();
[ViewVariables]
[DataField("tagRequirements")]
private Dictionary<string, GenericPartInfo> _tagRequirements = new();
public readonly Dictionary<string, GenericPartInfo> TagRequirements = new();
[ViewVariables]
[DataField("componentRequirements")]
private Dictionary<string, GenericPartInfo> _componentRequirements = new();
public readonly Dictionary<string, GenericPartInfo> ComponentRequirements = new();
[ViewVariables(VVAccess.ReadWrite)]
[DataField("prototype")]
public string Prototype { get; private set; }
public IReadOnlyDictionary<MachinePart, int> Requirements => _requirements;
public IReadOnlyDictionary<string, int> MaterialIdRequirements => _materialIdRequirements;
public string? Prototype { get; private set; }
public IEnumerable<KeyValuePair<StackPrototype, int>> MaterialRequirements
{
@@ -56,10 +52,6 @@ namespace Content.Server.GameObjects.Components.Construction
}
}
public IReadOnlyDictionary<string, GenericPartInfo> ComponentRequirements => _componentRequirements;
public IReadOnlyDictionary<string, GenericPartInfo> TagRequirements => _tagRequirements;
public void Examine(FormattedMessage message, bool inDetailsRange)
{
message.AddMarkup(Loc.GetString("Requires:\n"));