fix(codegen): Code gens base armor and fixes code genning of other armors. (#696)

* Fixes code gen of save flags
* Code gens rest of armor
* Fixes some existing code genned armors
* Code gens BaseArmor
This commit is contained in:
Kamron Batman 2021-08-17 17:52:15 -07:00 committed by GitHub
parent 803d594300
commit c8a2605c0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
127 changed files with 1107 additions and 1959 deletions

View file

@ -37,7 +37,8 @@ namespace SerializationGenerator
public static void GenerateEnumValue(this StringBuilder source, string indent, bool isFlag, string name, int value)
{
var valueStr = isFlag ? $"0x{1 << value:X8}" : value.ToString();
var number = value < 0 ? 0 : 1 << value;
var valueStr = isFlag ? $"0x{number:X8}" : value.ToString();
source.AppendLine($"{indent}{name} = {valueStr},");
}