diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisConstraint.cs b/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisConstraint.cs index adeed4e5fc..78c5ea606f 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisConstraint.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisConstraint.cs @@ -1,9 +1,11 @@ +#nullable enable + namespace BizHawk.Emulation.Common { public interface AxisConstraint { - public string Class { get; } + public string? Class { get; } - public string PairedAxis { get; } + public string? PairedAxis { get; } } } diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisDict.cs b/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisDict.cs index 88d3577762..e1b2d2633c 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisDict.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisDict.cs @@ -1,3 +1,5 @@ +#nullable enable + using System.Collections; using System.Collections.Generic; diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisPairOrientation.cs b/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisPairOrientation.cs index 89c5808fcc..4410bb19bc 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisPairOrientation.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisPairOrientation.cs @@ -1,3 +1,5 @@ +#nullable enable + namespace BizHawk.Emulation.Common { /// represents the direction of (+, +) diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisSpec.cs b/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisSpec.cs index 79767e4c11..491a1f3a56 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisSpec.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Axes/AxisSpec.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using BizHawk.Common; @@ -11,7 +13,7 @@ namespace BizHawk.Emulation.Common /// For instance, a N64 controller's analog range is actually larger than the amount allowed by the plastic that artificially constrains it to lower values /// Axis constraints provide a way to technically allow the full range but have a user option to constrain down to typical values that a real control would have /// - public readonly AxisConstraint Constraint; + public readonly AxisConstraint? Constraint; public Range FloatRange => ((float) Min).RangeTo(Max); @@ -27,11 +29,11 @@ namespace BizHawk.Emulation.Common public int Min => Range.Start; - public string PairedAxis => Constraint?.PairedAxis; + public string? PairedAxis => Constraint?.PairedAxis; public readonly Range Range; - public AxisSpec(Range range, int mid, bool isReversed = false, AxisConstraint constraint = null) + public AxisSpec(Range range, int mid, bool isReversed = false, AxisConstraint? constraint = null) { Constraint = constraint; IsReversed = isReversed; diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Axes/CircularAxisConstraint.cs b/src/BizHawk.Emulation.Common/Base Implementations/Axes/CircularAxisConstraint.cs index 6d9920093b..1300b9e397 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Axes/CircularAxisConstraint.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Axes/CircularAxisConstraint.cs @@ -1,10 +1,12 @@ +#nullable enable + using System; namespace BizHawk.Emulation.Common { public sealed class CircularAxisConstraint : AxisConstraint { - public string Class { get; } + public string? Class { get; } private readonly float Magnitude; diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Axes/NoOpAxisConstraint.cs b/src/BizHawk.Emulation.Common/Base Implementations/Axes/NoOpAxisConstraint.cs index 5c4b278aea..773d3f6301 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Axes/NoOpAxisConstraint.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Axes/NoOpAxisConstraint.cs @@ -1,10 +1,12 @@ +#nullable enable + namespace BizHawk.Emulation.Common { public sealed class NoOpAxisConstraint : AxisConstraint { - public string Class { get; } = null; + public string? Class { get; } = null; - public string PairedAxis { get; } + public string? PairedAxis { get; } public NoOpAxisConstraint(string pairedAxis) => PairedAxis = pairedAxis; }