Ejemplo n.º 1
0
        public DataBuilderV2(string logFileName, DateTime today, IWurmApiLogger logger)
        {
            if (logFileName == null)
            {
                throw new ArgumentNullException(nameof(logFileName));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            this.logFileName = logFileName;
            this.today       = today;
            this.logger      = logger;

            var logDate = ParsingHelper.GetDateFromLogFileName(logFileName);

            if (logDate.LogSavingType != LogSavingType.Monthly)
            {
                throw new WurmApiException("This builder can only be used for monthly log files, actual file name: " + logFileName);
            }

            ProcessedLogDate         = logDate.DateTime;
            DayCountInThisLogMonth   = ParsingHelper.GetDaysInMonthForLogFile(logFileName);
            ThisLogIsForCurrentMonth = ProcessedLogDate.Year == today.Year && ProcessedLogDate.Month == today.Month;
        }