From 3bf0334c59061f847a0d42f6e53fb63d8acc228c Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 15 Nov 2019 14:54:29 +0100 Subject: [PATCH] ZoneCodeGenerator: Add and rename member computations to make more sense --- .../Generating/Computations/MemberComputations.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ZoneCodeGenerator/Generating/Computations/MemberComputations.cs b/src/ZoneCodeGenerator/Generating/Computations/MemberComputations.cs index 5d88f196..b18f1397 100644 --- a/src/ZoneCodeGenerator/Generating/Computations/MemberComputations.cs +++ b/src/ZoneCodeGenerator/Generating/Computations/MemberComputations.cs @@ -10,6 +10,10 @@ namespace ZoneCodeGenerator.Generating.Computations { private readonly MemberInformation information; + public bool ShouldIgnore => information.Condition != null + && information.Condition.IsStatic + && information.Condition.EvaluateNumeric() == 0; + public bool IsNonEmbeddedReference => information.Member.VariableType.References.OfType().Any(); public bool IsSinglePointerReference => information.Member.VariableType.References.Any() @@ -30,6 +34,10 @@ namespace ZoneCodeGenerator.Generating.Computations public bool IsArrayReference => information.Member.VariableType.References.Any() && information.Member.VariableType.References.Last() is ReferenceTypeArray; + public bool IsArray => information.Member.VariableType.References + .OfType() + .Any(); + public IEnumerable ArraySizes => information.Member.VariableType.References .OfType() .Select(array => array.ArraySize); @@ -38,8 +46,8 @@ namespace ZoneCodeGenerator.Generating.Computations .OfType() .Count(); - public bool IsSinglePointer => PointerDepth == 1; - public bool IsDoublePointer => PointerDepth == 2; + public bool PointerDepthIsOne => PointerDepth == 1; + public bool PointerDepthIsTwo => PointerDepth == 2; public MemberComputations(MemberInformation information) {