diff --git a/src/ZoneCodeGenerator/Domain/Information/StructureInformation.cs b/src/ZoneCodeGenerator/Domain/Information/StructureInformation.cs index 9a65927f..25abce53 100644 --- a/src/ZoneCodeGenerator/Domain/Information/StructureInformation.cs +++ b/src/ZoneCodeGenerator/Domain/Information/StructureInformation.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using ZoneCodeGenerator.Domain.FastFileStructure; +using ZoneCodeGenerator.Generating.Computations; using ZoneCodeGenerator.Persistence; namespace ZoneCodeGenerator.Domain.Information @@ -33,6 +34,7 @@ namespace ZoneCodeGenerator.Domain.Information public bool IsLeaf { get; set; } public List NameChain { get; set; } + public StructureComputations Computations => new StructureComputations(this); public StructureInformation(DataTypeWithMembers type) { diff --git a/src/ZoneCodeGenerator/Generating/Computations/StructureComputations.cs b/src/ZoneCodeGenerator/Generating/Computations/StructureComputations.cs new file mode 100644 index 00000000..687a716a --- /dev/null +++ b/src/ZoneCodeGenerator/Generating/Computations/StructureComputations.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Linq; +using ZoneCodeGenerator.Domain; +using ZoneCodeGenerator.Domain.Evaluation; +using ZoneCodeGenerator.Domain.Information; + +namespace ZoneCodeGenerator.Generating.Computations +{ + class StructureComputations + { + private readonly StructureInformation information; + + public bool IsUsed => information.Usages.Any(); + + public StructureComputations(StructureInformation information) + { + this.information = information; + } + } +} \ No newline at end of file