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 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Brains.Framework;
using Brains.Framework.Utility;
namespace Brains.Framework.Grouping
{
public class Group
{
static int ID = 0;
private static int GetNextID()
{
return ID++;
}
public int GroupID { get; set; }
public List<Agent> Agents { get; set; }
public Group()
{
Agents = new List<Agent>();
GroupID = GetNextID();
}
public void AddAgent(Agent boid)
{
boid.SetLabel(AIConsts.ISGROUPMEMBER, 1);
boid.SetLabel(AIConsts.GROUPID, GroupID);
Agents.Add(boid);
}
}
} |