Skip to content

Commit

Permalink
Add class name
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBang1112 committed Jan 21, 2025
1 parent 0f4c262 commit cdba52c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Generators/GBX.NET.Generators/Utils/ClassIdParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ public static Dictionary<uint, string> Parse(TextReader reader)
// combine engine and class like EECCC000
var classId = (uint)((currentEngineByte << 24) | (classPart << 12));

result.Add(classId, currentClassName);
if (!result.TryGetValue(classId, out var curName) || string.IsNullOrEmpty(curName))
{
result[classId] = currentClassName;
}
else
{
throw new Exception($"Duplicate class id {classId:X8} with names '{curName}' and '{currentClassName}'.");
}
}
else
{
Expand Down
Binary file modified Resources/ClassIdManual.txt
Binary file not shown.

0 comments on commit cdba52c

Please sign in to comment.