Added dump to exe tester to export all classnames

- Added dump feature to exe. this will export all classnames used in
loot tables
- Updates build script to latest msbuild
- Small syntax update
This commit is contained in:
Matthew McConnell 2017-08-04 16:51:25 +01:00
parent 6729e5eadd
commit 5326229c31
4 changed files with 16 additions and 7 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ src/ExileLootDropTester/obj/*
src/packages/*
.hgignore
@ExileLootDrop.zip
src/ExileLootDropTester/ExileLootDropTester.csproj.user

View File

@ -1,4 +1,4 @@
set MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe"
set MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MsBuild.exe"
set MAKEPBO="C:\Program Files (x86)\Mikero\DePboTools\bin\MakePbo.exe"
rd /s /q @ExileLootDrop

View File

@ -56,7 +56,7 @@ namespace ExileLootDrop
}
private readonly List<CfgGroup> _cfgGroups;
private Dictionary<string, LootTable> Table { get; } = new Dictionary<string, LootTable>();
public Dictionary<string, LootTable> Table { get; } = new Dictionary<string, LootTable>();
/// <summary>
/// Loot constructor

View File

@ -1,21 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ExileLootDrop;
namespace ExileLootDropTester
{
class Program
internal class Program
{
const int Loops = 50000;
private const int Loops = 50000;
static void Main(string[] args)
private static void Main(string[] args)
{
Console.WriteLine("Loading Loot");
//Loot.LootTable
Console.WriteLine();
var tables = Loot.LootTable.GetTables();
if (args.Length > 0 && args[0] == "dump")
{
File.WriteAllText(
Path.Combine(Environment.CurrentDirectory, "dump.txt"),
$"[\"{string.Join("\",\"", tables.Select(table => string.Join("\",\"", Loot.LootTable.Table[table].LootItems.Select(l => l.Item))))}\"]"
);
return;
}
for (var i = 0; i < tables.Length; i++)
{
var table = tables[i];
@ -25,8 +34,7 @@ namespace ExileLootDropTester
Console.WriteLine("Select a table: ");
var input = Console.ReadLine();
Console.WriteLine();
int index;
if (!int.TryParse(input, out index))
if (!int.TryParse(input, out int index))
{
Console.WriteLine("input error");
return;