示例#1
0
        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);
        }
示例#2
0
        private void BuildLogger_GameLoop_DayEnding()
        {
            ToggleableEventLogger <DayEndingEventArgs> logger = BuildLogger(
                "day-ending",
                (DayEndingEventArgs args) => "GameLoop.DayEnding"
                );

            Helper.Events.GameLoop.DayEnding += logger.OnEvent;
        }
示例#3
0
        private void BuildLogger_GameLoop_DayStarted()
        {
            ToggleableEventLogger <DayStartedEventArgs> logger = BuildLogger(
                "day-started",
                (DayStartedEventArgs args) => "GameLoop.DayStarted"
                );

            Helper.Events.GameLoop.DayStarted += logger.OnEvent;
        }
示例#4
0
        private void BuildLogger_GameLoop_SaveLoaded()
        {
            ToggleableEventLogger <SaveLoadedEventArgs> logger = BuildLogger(
                "save-loaded",
                (SaveLoadedEventArgs args) => "GameLoop.SaveLoaded"
                );

            Helper.Events.GameLoop.SaveLoaded += logger.OnEvent;
        }
示例#5
0
        private void BuildLogger_GameLoop_Saving()
        {
            ToggleableEventLogger <SavingEventArgs> logger = BuildLogger(
                "saving",
                (SavingEventArgs args) => "GameLoop.Saving"
                );

            Helper.Events.GameLoop.Saving += logger.OnEvent;
        }
示例#6
0
        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;
        }
示例#7
0
        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;
        }
示例#8
0
        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;
        }