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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user