Exemplo n.º 1
0
        public void TestInitialize()
        {
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Verbose()
                         .WriteTo.Console()
                         .Enrich.FromLogContext()
                         .CreateLogger();

            _itemInfos = AlliedModsWiki.GetItemInfos();

            var itemInfoSource  = new ItemInfoSource(_itemInfos);
            var classNameSource = new ClassNameSource();

            _transformations = new Dictionary <string, ITransformation <Node> >
            {
                {
                    "tf2rebalance_attributes", new Tf2RebalanceTransformation(itemInfoSource,
                                                                              classNameSource)
                },
                {
                    "Custom Attributes", new CustomAttributesTransformation(itemInfoSource,
                                                                            classNameSource)
                },
            };
        }
Exemplo n.º 2
0
        private static void Execute(IList <string> files, IRebalanceInfoFormatter formatter, IFileSystem fileSystem)
        {
            IDictionary <string, List <ItemInfo> > weaponNames = AlliedModsWiki.GetItemInfos();
            var itemInfoSource  = new ItemInfoSource(weaponNames);
            var classNameSource = new ClassNameSource();
            var transformations = new Dictionary <string, ITransformation <Node> >
            {
                {
                    "tf2rebalance_attributes", new Tf2RebalanceTransformation(itemInfoSource,
                                                                              classNameSource)
                },
                {
                    "Custom Attributes", new CustomAttributesTransformation(itemInfoSource,
                                                                            classNameSource)
                },
            };
            IConverter converter = new CompositeTf2FormatConverter(new ValveFormatParser(), transformations);

            foreach (string filename in files)
            {
                CreateSummary(filename, converter, formatter, fileSystem);
            }

            Log.Information("finished creating summaries for {ConfigFileCount} configs", files.Count);
        }