示例#1
0
 public ArrayList getNeighboursInRange(AIEntity target, double range)
 {
     ArrayList list = new ArrayList();
     foreach( KeyValuePair<int, AIEntity> ent in entityDictionary){
         AIEntity temp = ent.Value;
         Vector to = temp.getPosition() - target.getPosition();
         double ran = range + temp.boundingRadius();
         if(temp.entityID() != target.entityID() && to.lengthSquared() < ran*ran)
             list.Add(temp);
     }
     return list;
 }
示例#2
0
 public void removeEntity(AIEntity a)
 {
     entityDictionary.Remove(a.entityID());
 }
示例#3
0
 public void addEntity(AIEntity a)
 {
     Debug.Log("Entity Added");
     entityDictionary.Add(a.entityID(),a);
 }