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 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace Brains.Framework.Designer
{
/// <summary>
/// The BehaviorNode class is used to load behaviors from file
/// </summary>
/// <remarks>There is no use for this class beyond what the editor provides.</remarks>
public class BehaviorNode
{
private string _typeName = "";
public string Name { get; set; }
[XmlIgnore()]
public Type Type { get; set; }
public string TypeName
{
get
{
if (Type == null || Type == typeof(System.Type))
return _typeName;
else
return Type.FullName;
}
set { _typeName = value; }
}
public List<Parameter> Parameters { get; set; }
public List<BehaviorNode> SubBehaviors { get; set; }
public BehaviorNode()
{
Parameters = new List<Parameter>();
SubBehaviors = new List<BehaviorNode>();
}
public void AddParameter(string name, string value)
{
Parameter p = new Parameter(name, value);
Parameters.Add(p);
}
public string BehaviorName { get; set; }
}
public class Parameter
{
public string Name { get; set; }
public string Value { get; set; }
public Parameter()
{
}
public Parameter(string name, string value)
{
Name = name;
Value = value;
}
}
} |