-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tree.cs
74 lines (66 loc) · 2.31 KB
/
Tree.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System.Collections.Generic;
namespace AVTTLoaderStandalone
{
/// <summary>
/// Represents a tech tree structure.
/// </summary>
public class Tree
{
public List<Node> Nodes = new List<Node>();
public string FilePath { get; set; }
public Tree(string fileName)
{
FilePath = fileName;
}
}
/// <summary>
/// Represents a node in a tech tree. Can iterate through attributes by calling Attributes. Can iterate through parts by calling Parts.
/// </summary>
public class Node
{
public Attribute Name = new Attribute();
public Attribute TechId = new Attribute();
public Attribute Pos = new Attribute();
public Attribute Icon = new Attribute();
public Attribute Cost = new Attribute();
public Attribute Title = new Attribute();
public Attribute Description = new Attribute();
public Attribute AnyParent = new Attribute();
public Attribute HideIfEmpty = new Attribute();
public Attribute Parents = new Attribute();
/// <summary>
/// All the parts in this node
/// </summary>
public List<Attribute> Parts = new List<Attribute>();
private readonly List<Attribute> _attributeList = new List<Attribute>();
/// <summary>
/// A list of all attributes in this node (not including the parts)
/// </summary>
public List<Attribute> Attributes {
get { return _attributeList; }
}
public Node()
{
Name.Item = "name";
TechId.Item = "techID";
Pos.Item = "pos";
Icon.Item = "icon";
Cost.Item = "cost";
Title.Item = "title";
Description.Item = "description";
AnyParent.Item = "anyParent";
HideIfEmpty.Item = "hideIfEmpty";
Parents.Item = "parents";
_attributeList.Add(Name);
_attributeList.Add(TechId);
_attributeList.Add(Pos);
_attributeList.Add(Icon);
_attributeList.Add(Cost);
_attributeList.Add(Title);
_attributeList.Add(Description);
_attributeList.Add(AnyParent);
_attributeList.Add(HideIfEmpty);
_attributeList.Add(Parents);
}
}
}