Author: conkerjo
(2009/07/18 09:44) Over 2 years ago
Missing Files
322
else
323
return Labels[labelid];
324
}
325
326
public List<Agent> GetNearbyAgents(int distance)
327
{
328
return ParentWorld._spatialtable.GetNearbyItems(this, distance);
329
330
331
93
<Compile Include="Behaviors\PathFinding\FindPathBehavior.cs" />
94
<Compile Include="Behaviors\PathFinding\FollowPathBehavior.cs" />
95
<Compile Include="Grouping\Group.cs" />
96
<Compile Include="Spatial\SpatialTable.cs" />
<Compile Include="Utility\AIConsts.cs" />
97
<Compile Include="Map\Cluster.cs" />
98
<Compile Include="Designer\BehaviorNode.cs" />
99
297
Vector2 SteeringForce=Vector2.Zero;
298
299
int NeighborCount = 0;
300
List<Agent> _agents = Owner.GetNearbyAgents(100);
301
//iterate through the neighbors and sum up all the position vectors
302
for (int a = 0; a < g.Agents.Count; ++a)
303
11
using Brains.Framework.Utility;
12
using Brains.Framework.Behaviors.PathFinding;
13
using Brains.Framework.Grouping;
14
using Brains.Spatial;
15
namespace Brains.Framework
16
17
...
26
private List<Agent> _agentsToRemove = new List<Agent>();
27
private Texture2D _mapTexture;
28
private WorldMap _map;
29
30
internal SpatialTable _spatialtable;
//
31
//Public properties
32
33
50
public World()
51
52
Groups = new Dictionary<int, Group>();
53
54
55
56
//Public Methods
57
112
int clusterRows = totalCols / maxclusterwidth;
114
113
int clusterCols = totalRows/ maxclusterheight;
115
_map.ClusterGrid.Setup(clusterRows, clusterCols);
116
117
_spatialtable = new SpatialTable();
118
_spatialtable.Setup(width, height, cellsize);
119
Vector2 position = new Vector2();
120
for (int y = 0; y < clusterRows; y++)
121
122
681
686
682
actor.ParentWorld = this;
687
683
Actors.Add(actor);
688
689
_spatialtable.RegisterObject(actor);
684
690
685
/// <summary>
691
/// Loads Map data from a texture
692
{List<Agent> _agents = Owner.GetNearbyAgents(100);{{{{internal SpatialTable _spatialtable;{{{{{{