Make CloudFluidType not nullable anymore

This commit is contained in:
Ben C 2022-05-23 09:19:16 -04:00 committed by GitHub
parent f1585c215a
commit 1d6a43c4fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 21 deletions

View File

@ -39,7 +39,7 @@ jobs:
- uses: actions/setup-dotnet@v1
# Disabe Strong Name Verification to let us pull a switch-a-roo
# Disable Strong Name Verification to let us pull a switch-a-roo
- run: "C:\\\"Program Files (x86)\"\\\"Microsoft SDKs\"\\Windows\\v10.0A\\bin\\\"NETFX 4.8 Tools\"\\x64\\sn.exe -Vr *"
- name: Build Project

View File

@ -81,16 +81,14 @@ namespace NewHorizons.Builder.Atmosphere
fluidCLFV._density = 1.2f;
var fluidType = FluidVolume.Type.CLOUD;
if (atmo.clouds.fluidType != null)
try
{
try
{
fluidType = (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(CloudFluidType), atmo.clouds.fluidType).ToUpper());
}
catch (Exception ex)
{
Logger.LogError($"Couldn't parse fluid volume type [{atmo.clouds.fluidType}]: {ex.Message}, {ex.StackTrace}");
}
fluidType = (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(CloudFluidType), atmo.clouds.fluidType).ToUpper());
}
catch (Exception ex)
{
Logger.LogError($"Couldn't parse fluid volume type [{atmo.clouds.fluidType}]: {ex.Message}, {ex.StackTrace}");
}
fluidCLFV._fluidType = fluidType;

View File

@ -48,16 +48,13 @@ namespace NewHorizons.Builder.Body
var sfv = ringVolume.AddComponent<SimpleFluidVolume>();
var fluidType = FluidVolume.Type.NONE;
if (ring.fluidType != null)
try
{
try
{
fluidType = (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(CloudFluidType), ring.fluidType).ToUpper());
}
catch (Exception ex)
{
Logger.LogError($"Couldn't parse fluid volume type [{ring.fluidType}]: {ex.Message}, {ex.StackTrace}");
}
fluidType = (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(CloudFluidType), ring.fluidType).ToUpper());
}
catch (Exception ex)
{
Logger.LogError($"Couldn't parse fluid volume type [{ring.fluidType}]: {ex.Message}, {ex.StackTrace}");
}
sfv._fluidType = fluidType;

View File

@ -95,7 +95,7 @@ namespace NewHorizons.External.Modules
/// Fluid type for sounds/effects when colliding with this cloud.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public CloudFluidType? fluidType = CloudFluidType.Cloud;
public CloudFluidType fluidType = CloudFluidType.Cloud;
/// <summary>
/// Add lightning to this planet like on Giant's Deep.

View File

@ -9,7 +9,7 @@ namespace NewHorizons.External.Modules.VariableSize
/// <summary>
/// Fluid type for sounds/effects when colliding with this ring.
/// </summary>
public CloudFluidType? fluidType = CloudFluidType.None;
public CloudFluidType fluidType = CloudFluidType.None;
/// <summary>
/// Angle between the rings and the equatorial plane of the planet.