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 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Brains.Framework.Behaviors
{
/// <summary>
/// Behavior Collection class
/// </summary>
/// <typeparam name="T"></typeparam>
public class BehaviorList<T>:List<T> where T : IBehavior
{
IBehavior _owner;
public IBehavior Owner
{
get { return _owner; }
set
{
_owner = value;
foreach (var item in this)
{
item.SetOwner(_owner.Owner);
}
}
}
}
} |