Esempio n. 1
0
        public SimcGenerationService(ILoggerFactory loggerFactory)
            : this(loggerFactory.CreateLogger <SimcGenerationService>(), null, null, null, null)
        {
            var dataExtractionService = new RawDataExtractionService(
                loggerFactory.CreateLogger <RawDataExtractionService>());
            var cacheService = new CacheService(dataExtractionService,
                                                loggerFactory.CreateLogger <CacheService>());
            var utilityService = new SimcUtilityService(
                cacheService,
                loggerFactory.CreateLogger <SimcUtilityService>());

            var spellCreationService = new SimcSpellCreationService(
                utilityService,
                loggerFactory.CreateLogger <SimcSpellCreationService>());

            _simcParserService = new SimcParserService(
                loggerFactory.CreateLogger <SimcParserService>());

            _simcItemCreationService = new SimcItemCreationService(
                cacheService,
                spellCreationService,
                utilityService,
                loggerFactory.CreateLogger <SimcItemCreationService>());

            _simcVersionService = new SimcVersionService(
                utilityService,
                loggerFactory.CreateLogger <SimcVersionService>());

            _simcSpellCreationService = spellCreationService;
        }
Esempio n. 2
0
 public SimcGenerationService(ILogger <SimcGenerationService> logger,
                              ISimcParserService simcParserService,
                              ISimcItemCreationService simcItemCreationService,
                              ISimcSpellCreationService simcSpellCreationService,
                              ISimcVersionService simcVersionService)
 {
     _logger                   = logger;
     _simcParserService        = simcParserService;
     _simcItemCreationService  = simcItemCreationService;
     _simcSpellCreationService = simcSpellCreationService;
     _simcVersionService       = simcVersionService;
 }
        public async Task Init()
        {
            // Load a data file
            var testFile         = @"RawData" + Path.DirectorySeparatorChar + "Hierophant.simc";
            var testFileContents = await File.ReadAllLinesAsync(testFile);

            TestFileString = new List <string>(testFileContents);

            // Create a new profile service
            using var loggerFactory = LoggerFactory.Create(builder => builder
                                                           .AddSerilog()
                                                           .AddFilter(level => level >= LogLevel.Trace));
            var logger = loggerFactory.CreateLogger <SimcParserService>();

            SimcParser = new SimcParserService(logger);
        }