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

ZoneCodeGenerator: Add tests for reordering, scriptstring, string

This commit is contained in:
Jan
2019-11-10 22:14:01 +01:00
parent 6ca7f18f9f
commit 73424c9bc1
6 changed files with 156 additions and 37 deletions

View File

@@ -1,4 +1,5 @@
using ZoneCodeGenerator.Domain.Evaluation;
using System.Linq;
using ZoneCodeGenerator.Domain.Evaluation;
namespace ZoneCodeGenerator.Domain.Information
{
@@ -6,15 +7,32 @@ namespace ZoneCodeGenerator.Domain.Information
{
public StructureInformation StructureType { get; }
public Variable Member { get; set; }
public bool IsString { get; set; }
public bool IsScriptString { get; set; }
public IEvaluation Condition { get; set; }
public bool IsNonEmbeddedReference => Member.VariableType.References.Any();
public bool IsSinglePointerReference => Member.VariableType.References.Any()
&& Member.VariableType.References.Last() is ReferenceTypePointer
pointerReference
&& !pointerReference.IsArray;
public bool IsArrayPointerReference => Member.VariableType.References.Any()
&& Member.VariableType.References.Last() is ReferenceTypePointer
pointerReference
&& pointerReference.IsArray;
public bool IsArrayReference => Member.VariableType.References.Any()
&& Member.VariableType.References.Last() is ReferenceTypeArray;
public MemberInformation(Variable member, StructureInformation structureType)
{
Member = member;
StructureType = structureType;
IsString = false;
IsScriptString = false;
Condition = null;
}
}
}
}

View File

@@ -24,7 +24,7 @@ namespace ZoneCodeGenerator.Domain.Information
}
public List<StructureInformation> Usages { get; }
public List<MemberInformation> OrderedMembers { get; }
public List<MemberInformation> OrderedMembers { get; set; }
public bool NonEmbeddedReferenceExists { get; set; }
public bool SinglePointerReferenceExists { get; set; }
public bool ArrayPointerReferenceExists { get; set; }