2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-06 16:57:25 +00:00

ZoneCodeGenerator: Add all used membertypes to a list in context

This commit is contained in:
Jan
2019-11-14 14:58:50 +01:00
parent d7f05b97c9
commit 8c303d394d
2 changed files with 16 additions and 19 deletions

View File

@@ -7,21 +7,8 @@ namespace ZoneCodeGenerator.Domain
{
private const int PointerSize = 4;
private DataType type;
public DataType Type
{
get
{
if (type is DataTypeTypedef typedef)
{
return typedef.TypeDefinition.Type;
}
public DataType Type { get; set; }
return type;
}
set => type = value;
}
public int? CustomBitSize { get; set; }
@@ -32,7 +19,7 @@ namespace ZoneCodeGenerator.Domain
private readonly List<ReferenceType> references;
public IReadOnlyList<ReferenceType> References => references.AsReadOnly();
public int Alignment => references.OfType<ReferenceTypePointer>().Any() ? PointerSize : type.Alignment;
public int Alignment => references.OfType<ReferenceTypePointer>().Any() ? PointerSize : Type.Alignment;
public int Size
{
@@ -59,9 +46,9 @@ namespace ZoneCodeGenerator.Domain
public TypeDeclaration(DataType type, List<ReferenceType> references)
{
this.type = type;
Type = type;
this.references = references ?? new List<ReferenceType>();
CustomBitSize = null;
}
}
}
}