From 610efc0367b3bd5a368e098830ad08250b755fd2 Mon Sep 17 00:00:00 2001 From: Anna Clemens Date: Mon, 6 Dec 2021 15:58:52 -0500 Subject: [PATCH] fix: update source generator --- csharp/RemotePartyFinder/RemotePartyFinder.csproj | 2 +- csharp/SourceGenerator/Program.cs | 8 ++++---- csharp/SourceGenerator/SourceGenerator.csproj | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/csharp/RemotePartyFinder/RemotePartyFinder.csproj b/csharp/RemotePartyFinder/RemotePartyFinder.csproj index d6f35c1..f5e74e6 100644 --- a/csharp/RemotePartyFinder/RemotePartyFinder.csproj +++ b/csharp/RemotePartyFinder/RemotePartyFinder.csproj @@ -39,7 +39,7 @@ - + diff --git a/csharp/SourceGenerator/Program.cs b/csharp/SourceGenerator/Program.cs index f184053..5a9ef88 100644 --- a/csharp/SourceGenerator/Program.cs +++ b/csharp/SourceGenerator/Program.cs @@ -261,7 +261,7 @@ namespace SourceGenerator { sb.Append(" pub static ref WORLDS: HashMap = maplit::hashmap! {\n"); foreach (var world in this.Data[Language.English].GetExcelSheet()!) { - if (world.RowId == 0 || !world.IsPublic || world.DataCenter.Row == 0) { + if (world.RowId == 0 || !world.Unknown5 || world.Unknown4 == 0 || world.DataCenter.Row == 0) { continue; } @@ -328,7 +328,7 @@ namespace SourceGenerator { pair => pair.Key, pair => { var sheet = (ExcelSheetImpl) getSheet.Invoke(pair.Value, null)!; - return (sheet, sheet.EnumerateRowParsers().ToArray()); + return (sheet, sheet.GetRowParsers().ToArray()); }); var columns = new List(); @@ -369,7 +369,7 @@ namespace SourceGenerator { foreach (var range in rows) { var validRows = sheets[Language.English] .Item2 - .Select(parser => parser.Row) + .Select(parser => parser.RowId) .ToArray(); for (var i = range.Start.Value; i < range.End.Value; i++) { if (!validRows.Contains((uint) i)) { @@ -384,7 +384,7 @@ namespace SourceGenerator { foreach (var (lang, (_, parsers)) in sheets) { // take the first column that works foreach (var col in columns) { - var rowParser = parsers.FirstOrDefault(parser => parser.Row == i); + var rowParser = parsers.FirstOrDefault(parser => parser.RowId == i); if (rowParser != null) { var name = rowParser.ReadColumn(col)!; var text = name.TextValue().Replace("\"", "\\\""); diff --git a/csharp/SourceGenerator/SourceGenerator.csproj b/csharp/SourceGenerator/SourceGenerator.csproj index 943bf6a..2e5aaf2 100644 --- a/csharp/SourceGenerator/SourceGenerator.csproj +++ b/csharp/SourceGenerator/SourceGenerator.csproj @@ -7,8 +7,8 @@ - - + +