Beispiel #1
0
        public LogsMonitorEngineManager(
            [NotNull] CharacterName characterName,
            [NotNull] CharacterLogsMonitorEngineFactory characterLogsMonitorEngineFactory,
            [NotNull] IPublicEventInvoker publicEventInvoker,
            [NotNull] IWurmApiLogger logger,
            [NotNull] IInternalEventInvoker internalEventInvoker)
        {
            if (characterName == null)
            {
                throw new ArgumentNullException(nameof(characterName));
            }
            if (characterLogsMonitorEngineFactory == null)
            {
                throw new ArgumentNullException(nameof(characterLogsMonitorEngineFactory));
            }
            if (publicEventInvoker == null)
            {
                throw new ArgumentNullException(nameof(publicEventInvoker));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (internalEventInvoker == null)
            {
                throw new ArgumentNullException(nameof(internalEventInvoker));
            }
            this.characterName        = characterName;
            this.publicEventInvoker   = publicEventInvoker;
            this.logger               = logger;
            this.internalEventInvoker = internalEventInvoker;

            engine = characterLogsMonitorEngineFactory.Create(characterName);
        }
        public LogsMonitorEngineManager(
            [NotNull] CharacterName characterName,
            [NotNull] CharacterLogsMonitorEngineFactory characterLogsMonitorEngineFactory,
            [NotNull] IPublicEventInvoker publicEventInvoker, 
            [NotNull] ILogger logger,
            [NotNull] IInternalEventInvoker internalEventInvoker)
        {
            if (characterName == null) throw new ArgumentNullException("characterName");
            if (characterLogsMonitorEngineFactory == null) throw new ArgumentNullException("characterLogsMonitorEngineFactory");
            if (publicEventInvoker == null) throw new ArgumentNullException("publicEventInvoker");
            if (logger == null) throw new ArgumentNullException("logger");
            if (internalEventInvoker == null) throw new ArgumentNullException("internalEventInvoker");
            this.characterName = characterName;
            this.characterLogsMonitorEngineFactory = characterLogsMonitorEngineFactory;
            this.publicEventInvoker = publicEventInvoker;
            this.logger = logger;
            this.internalEventInvoker = internalEventInvoker;

            engine = characterLogsMonitorEngineFactory.Create(characterName);
        }