Esempio n. 1
0
    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);
    }
Esempio n. 2
0
 public void AddElement(ISwarmElement element)
 {
 }
Esempio n. 3
0
 public void RemoveElement(ISwarmElement element)
 {
 }