2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-03 23:37:26 +00:00

ZoneCodeGenerator: Add computations for single references to be able to correctly handle arrays

This commit is contained in:
Jan
2019-11-24 01:58:01 +01:00
parent 6d1359c3d9
commit 5d3c13e833
15 changed files with 418 additions and 223 deletions

View File

@@ -27,16 +27,16 @@ namespace ZoneCodeGenerator.Parsing.CommandFile.PostProcessor
.Where(member => member.StructureType != null)
.Where(member => !member.Computations.ShouldIgnore))
{
if (member.Computations.IsNonEmbeddedReference)
if (member.Computations.ContainsNonEmbeddedReference)
member.StructureType.NonEmbeddedReferenceExists = true;
if (member.Computations.IsSinglePointerReference)
if (member.Computations.ContainsSinglePointerReference)
member.StructureType.SinglePointerReferenceExists = true;
if (member.Computations.IsArrayPointerReference)
if (member.Computations.ContainsArrayPointerReference)
member.StructureType.ArrayPointerReferenceExists = true;
if (member.Computations.IsArrayReference)
if (member.Computations.ContainsArrayReference)
member.StructureType.ArrayReferenceExists = true;
member.StructureType.Usages.Add(currentStructure);

View File

@@ -50,7 +50,7 @@ namespace ZoneCodeGenerator.Parsing.CommandFile.Tests
for (var i = 0; i < memberList.Count - 1; i++)
{
if (!memberList[i].Computations.IsEmbeddedReference)
if (memberList[i].Computations.ContainsNonEmbeddedReference)
{
throw new TestFailedException("Can only add embedded members to name chain.");
}

View File

@@ -52,7 +52,7 @@ namespace ZoneCodeGenerator.Parsing.CommandFile.Tests
var lastMember = memberList.Last();
if (!lastMember.Computations.IsNonEmbeddedReference)
if (!lastMember.Computations.ContainsNonEmbeddedReference)
{
throw new TestFailedException($"Specified member '{lastMember.Member.Name}' is not a pointer reference and therefore cannot be reusable.");
}

View File

@@ -56,7 +56,7 @@ namespace ZoneCodeGenerator.Parsing.CommandFile.Tests
throw new TestFailedException($"Specified member '{lastMember.Member.Name}' is not char type and therefore cannot be a string.");
}
if (!lastMember.Computations.IsSinglePointerReference)
if (!lastMember.Computations.ContainsSinglePointerReference)
{
throw new TestFailedException($"Specified member '{lastMember.Member.Name}' is a single pointer reference and therefore cannot be a string.");
}