IMHOTEP Framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Structure.cs
1 using System;
2 using System.Collections.Generic;
3 
4 
5 namespace BlenderMeshReader
6 {
7  class Structure
8  {
9  public int Index { get; private set; }
10  public string Name { get; private set; } //Name of Structure
11  public List<Field> Fields { get; set; }
12 
13  public Structure(string name, int index)
14  {
15  this.Name = name;
16  this.Index = index;
17  this.Fields = new List<Field>();
18  }
19 
20 
21  public int getLength()
22  {
23  int l = 0;
24  foreach (Field f in Fields)
25  {
26  l += f.getLength();
27  }
28  return l;
29  }
30 
31  public override string ToString()
32  {
33  string result = Name + " {" + Index + "}" + " - " + getLength() + "byte" + Environment.NewLine;
34  foreach(Field f in Fields)
35  {
36  result += " "+f.ToString() + Environment.NewLine;
37  }
38  return result;
39  }
40 
41  }
42 }