- Modified DNAClassAttribute to also support usage on structs

- Added auto generation of DNAClass attributes on file generation
- Regenerated all files
This commit is contained in:
Samuele Lorefice
2025-01-23 16:15:50 +01:00
parent 7c0708b377
commit 0674e6b136
938 changed files with 942 additions and 2 deletions

View File

@@ -81,6 +81,10 @@ namespace CodeGenerator {
//Create a new type declaration
var ctd = new CodeTypeDeclaration(type.Type);
ctd.CustomAttributes.Add(new CodeAttributeDeclaration("DNAClassAttribute",
new CodeAttributeArgument(new CodePrimitiveExpression(type.IdxType)),
new CodeAttributeArgument(new CodePrimitiveExpression(type.Type))
));
foreach (var field in type.Fields) {
if (field.Name.Contains("*")) {
@@ -247,7 +251,7 @@ namespace CodeGenerator {
};
ctd.BaseTypes.Add(new CodeTypeReference(typeof(Attribute)));
ctd.CustomAttributes.Add(new("AttributeUsage",
new CodeAttributeArgument(new CodeSnippetExpression("AttributeTargets.Class"))));
new CodeAttributeArgument(new CodeSnippetExpression("AttributeTargets.Class | AttributeTargets.Struct"))));
var cmf = new CodeMemberField(typeof(int), "_originalIndex") {