change to prim Ctors

This commit is contained in:
CWX
2025-01-18 19:17:35 +00:00
parent 41d2bfa1d9
commit 5c5a42b535
25 changed files with 551 additions and 973 deletions
+9 -27
View File
@@ -13,35 +13,17 @@ using Core.Services;
namespace Core.Controllers;
[Injectable]
public class WeatherController
public class WeatherController(
ISptLogger<WeatherController> _logger,
WeatherGenerator _weatherGenerator,
SeasonalEventService _seasonalEventService,
RaidWeatherService _raidWeatherService,
WeatherHelper _weatherHelper,
ConfigServer _configServer
)
{
protected ISptLogger<WeatherController> _logger;
protected WeatherGenerator _weatherGenerator;
protected SeasonalEventService _seasonalEventService;
protected RaidWeatherService _raidWeatherService;
protected WeatherHelper _weatherHelper;
protected ConfigServer _configServer;
protected WeatherConfig _weatherConfig = _configServer.GetConfig<WeatherConfig>();
protected WeatherConfig _weatherConfig;
public WeatherController(
ISptLogger<WeatherController> logger,
WeatherGenerator weatherGenerator,
SeasonalEventService seasonalEventService,
RaidWeatherService raidWeatherService,
WeatherHelper weatherHelper,
ConfigServer configServer
)
{
_logger = logger;
_weatherGenerator = weatherGenerator;
_seasonalEventService = seasonalEventService;
_raidWeatherService = raidWeatherService;
_weatherHelper = weatherHelper;
_configServer = configServer;
_weatherConfig = _configServer.GetConfig<WeatherConfig>();
}
/// <summary>
/// Handle client/weather