Modify ClimateIs* functions for legibility

This commit is contained in:
Aaron van Geffen 2024-05-09 00:30:44 +02:00
parent 400c48e74f
commit 50216e7d3a
1 changed files with 8 additions and 12 deletions

View File

@ -233,29 +233,25 @@ void ClimateUpdateSound()
bool ClimateIsRaining()
{
auto& gameState = GetGameState();
return gameState.ClimateCurrent.Weather == WeatherType::Rain || gameState.ClimateCurrent.Weather == WeatherType::HeavyRain
|| gameState.ClimateCurrent.Weather == WeatherType::Thunder;
auto& weather = GetGameState().ClimateCurrent.Weather;
return weather == WeatherType::Rain || weather == WeatherType::HeavyRain || weather == WeatherType::Thunder;
}
bool ClimateIsSnowing()
{
auto& gameState = GetGameState();
return gameState.ClimateCurrent.Weather == WeatherType::Snow || gameState.ClimateCurrent.Weather == WeatherType::HeavySnow
|| gameState.ClimateCurrent.Weather == WeatherType::Blizzard;
auto& weather = GetGameState().ClimateCurrent.Weather;
return weather == WeatherType::Snow || weather == WeatherType::HeavySnow || weather == WeatherType::Blizzard;
}
bool ClimateIsSnowingHeavily()
{
auto& gameState = GetGameState();
return gameState.ClimateCurrent.Weather == WeatherType::HeavySnow
|| gameState.ClimateCurrent.Weather == WeatherType::Blizzard;
auto& weather = GetGameState().ClimateCurrent.Weather;
return weather == WeatherType::HeavySnow || weather == WeatherType::Blizzard;
}
bool WeatherIsDry(WeatherType weatherType)
bool WeatherIsDry(WeatherType weather)
{
return weatherType == WeatherType::Sunny || weatherType == WeatherType::PartiallyCloudy
|| weatherType == WeatherType::Cloudy;
return weather == WeatherType::Sunny || weather == WeatherType::PartiallyCloudy || weather == WeatherType::Cloudy;
}
FilterPaletteID ClimateGetWeatherGloomPaletteId(const ClimateState& state)