private ISwarmElement implGetClosestUnit(Vector2 pos, List <ISwarmElement> candidatesList) { ISwarmElement result = null; float resultDistance = float.PositiveInfinity; foreach (var n in candidatesList) { var distance = Vector2.Distance(n.iTargertPosition, pos); if (distance < resultDistance) { resultDistance = distance; result = n; } } return(result); }
public void AddElement(ISwarmElement element) { }
public void RemoveElement(ISwarmElement element) { }