Added nullable to most Content.Shared files (#3238)
* Add nullable to some Content.Shared files. * Use [NotNullWhen(true)] * Undo adding now redundant !'s * Forgot one * Add a ton more nullable * You can guess * Fix some issues * It actually compiles now * Auto stash before merge of "null2" and "origin/master" * I lied * enable annotations -> enable * Revert ActionBlockerSystem.cs to original * Fix ActionBlockerSystem.cs * More nullable * Undo some added exclamation marks * Fix issues * Update Content.Shared/Maps/ContentTileDefinition.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Resolve some issues * Remove unused method * Fix more issues * Fix more issues * Fix more issues * Fix more issues * Fix issue, rollback SharedGhostComponent.cs * Update submodule * Fix issue, invert some if-statements to reduce nesting * Revert RobustToolbox * FIx things broken by merge * Some fixes - Replaced with string.Empty - Remove some exclamation marks - Revert file * Some fixes * Trivial #nullable enable * Fix null ables Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -10,9 +11,9 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
|
||||
[Prototype("MeleeWeaponAnimation")]
|
||||
public sealed class MeleeWeaponAnimationPrototype : IPrototype
|
||||
{
|
||||
private string _prototype;
|
||||
private string _state;
|
||||
private string _id;
|
||||
private string _prototype = "WeaponArc";
|
||||
private string _state = string.Empty;
|
||||
private string _id = string.Empty;
|
||||
private Vector4 _colorDelta;
|
||||
private Vector4 _color;
|
||||
private TimeSpan _length;
|
||||
@@ -35,8 +36,8 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
|
||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||
|
||||
serializer.DataField(ref _prototype, "prototype", "WeaponArc");
|
||||
serializer.DataField(ref _state, "state", null);
|
||||
serializer.DataField(ref _id, "id", null);
|
||||
serializer.DataField(ref _state, "state", string.Empty);
|
||||
serializer.DataField(ref _id, "id", string.Empty);
|
||||
serializer.DataField(ref _colorDelta, "colorDelta", Vector4.Zero);
|
||||
serializer.DataField(ref _color, "color", new Vector4(1, 1, 1, 1));
|
||||
if (serializer.TryReadDataField("length", out float length))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -31,12 +32,12 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged.Barrels
|
||||
public FireRateSelector FireRateSelector { get; }
|
||||
public (int count, int max)? Magazine { get; }
|
||||
public string SoundGunshot { get; }
|
||||
|
||||
|
||||
public MagazineBarrelComponentState(
|
||||
bool chambered,
|
||||
FireRateSelector fireRateSelector,
|
||||
bool chambered,
|
||||
FireRateSelector fireRateSelector,
|
||||
(int count, int max)? magazine,
|
||||
string soundGunshot) :
|
||||
string soundGunshot) :
|
||||
base(ContentNetIDs.MAGAZINE_BARREL)
|
||||
{
|
||||
Chambered = chambered;
|
||||
@@ -45,4 +46,4 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged.Barrels
|
||||
SoundGunshot = soundGunshot;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -9,4 +10,4 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class MagazineAutoEjectMessage : ComponentMessage {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
@@ -18,7 +19,7 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged
|
||||
public sealed class RangedWeaponComponentState : ComponentState
|
||||
{
|
||||
public FireRateSelector FireRateSelector { get; }
|
||||
|
||||
|
||||
public RangedWeaponComponentState(
|
||||
FireRateSelector fireRateSelector
|
||||
) : base(ContentNetIDs.RANGED_WEAPON)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
Reference in New Issue
Block a user