示例#1
0
 public EddnPlugin(ISettingsProvider settingsProvider, IPlayerStateHistoryRecorder playerStateRecorder, IRestClientFactory restClientFactory)
 {
     this.settingsProvider             = settingsProvider ?? throw new ArgumentNullException(nameof(settingsProvider));
     this.playerStateRecorder          = playerStateRecorder ?? throw new ArgumentNullException(nameof(playerStateRecorder));
     eventConverter                    = new EddnEventConverter(playerStateRecorder);
     settingsProvider.SettingsChanged += (o, e) => ReloadSettings();
     apiFacade = new EddnApiFacade(restClientFactory.CreateRestClient(EddnUrl));
     ReloadSettings();
 }
 public EddnPlugin(ISettingsProvider settingsProvider, IPlayerStateHistoryRecorder playerStateRecorder) : base(settingsProvider)
 {
     this.settingsProvider    = settingsProvider ?? throw new ArgumentNullException(nameof(settingsProvider));
     this.playerStateRecorder = playerStateRecorder ?? throw new ArgumentNullException(nameof(playerStateRecorder));
     eventConverter           = new EddnEventConverter(playerStateRecorder)
     {
         UploaderID = settingsProvider.Settings.CommanderName
     };
     settingsProvider.SettingsChanged += (o, e) => ReloadSettings();
     ReloadSettings();
 }