private ToggleableEventLogger <T> BuildLogger <T>([NotNull] string name, Func <T, string> message) where T : EventArgs { var logger = new ToggleableEventLogger <T>(name, Monitor, message); _loggers.Add(logger); return(logger); }
private void BuildLogger_GameLoop_DayEnding() { ToggleableEventLogger <DayEndingEventArgs> logger = BuildLogger( "day-ending", (DayEndingEventArgs args) => "GameLoop.DayEnding" ); Helper.Events.GameLoop.DayEnding += logger.OnEvent; }
private void BuildLogger_GameLoop_DayStarted() { ToggleableEventLogger <DayStartedEventArgs> logger = BuildLogger( "day-started", (DayStartedEventArgs args) => "GameLoop.DayStarted" ); Helper.Events.GameLoop.DayStarted += logger.OnEvent; }
private void BuildLogger_GameLoop_SaveLoaded() { ToggleableEventLogger <SaveLoadedEventArgs> logger = BuildLogger( "save-loaded", (SaveLoadedEventArgs args) => "GameLoop.SaveLoaded" ); Helper.Events.GameLoop.SaveLoaded += logger.OnEvent; }
private void BuildLogger_GameLoop_Saving() { ToggleableEventLogger <SavingEventArgs> logger = BuildLogger( "saving", (SavingEventArgs args) => "GameLoop.Saving" ); Helper.Events.GameLoop.Saving += logger.OnEvent; }
private void BuildLogger_World_LargeTerrainFeatureListChanged() { ToggleableEventLogger <LargeTerrainFeatureListChangedEventArgs> logger = BuildLogger( "large-terrain", (LargeTerrainFeatureListChangedEventArgs args) => $"World.LargeTerrainFeatureListChanged {args.Location.Name} +{args.Added.Count()} -{args.Removed.Count()}" ); Helper.Events.World.LargeTerrainFeatureListChanged += logger.OnEvent; }
private void BuildLogger_World_LocationListChanged() { ToggleableEventLogger <LocationListChangedEventArgs> logger = BuildLogger( "locations", (LocationListChangedEventArgs args) => $"World.LocationListChanged +{args.Added.Count()} -{args.Removed.Count()}" ); Helper.Events.World.LocationListChanged += logger.OnEvent; }
private void BuildLogger_World_ObjectListChanged() { ToggleableEventLogger <ObjectListChangedEventArgs> logger = BuildLogger( "objects", (ObjectListChangedEventArgs args) => $"World.ObjectListChanged {args.Location.Name} +{args.Added.Count()} -{args.Removed.Count()}" ); Helper.Events.World.ObjectListChanged += logger.OnEvent; }