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; }
public void removeEntity(AIEntity a) { entityDictionary.Remove(a.entityID()); }
public void addEntity(AIEntity a) { Debug.Log("Entity Added"); entityDictionary.Add(a.entityID(),a); }