source: OniSplit/Metadata/MetaArray.cs@ 1139

Last change on this file since 1139 was 1114, checked in by iritscen, 5 years ago

Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.

File size: 788 bytes
RevLine 
[1114]1using System;
2using System.Globalization;
3
4namespace Oni.Metadata
5{
6 internal class MetaArray : MetaType
7 {
8 private readonly MetaType elementType;
9 private readonly int count;
10
11 public MetaArray(MetaType elementType, int count)
12 {
13 this.elementType = elementType;
14 this.count = count;
15
16 Name = string.Format(CultureInfo.InvariantCulture, "{0}[{1}]", elementType.Name, count);
17 Size = elementType.Size * count;
18 }
19
20 public MetaType ElementType => elementType;
21
22 public int Count => count;
23
24 protected override bool IsLeafImpl() => elementType.IsLeaf;
25
26 public override void Accept(IMetaTypeVisitor visitor) => visitor.VisitArray(this);
27 }
28}
Note: See TracBrowser for help on using the repository browser.