Exemple #1
0
        public void OrientNonMappedOnNearestMapped(Objective[] objectives)
        {
            foreach (var objective in objectives)
            {

                if (_distanceData.ContainsKey(objective)) continue;
                var nearestObjective = objectives.Where(obj => _distanceData.ContainsKey(obj)).OrderBy(obj => obj.Position.Distance(objective.Position)).FirstOrDefault();
                if (nearestObjective != null) SetDistanceTo(objective, _distanceData[nearestObjective] + nearestObjective.Position.Distance(objective.Position));
            }
        }
Exemple #2
0
 public void SetDistanceTo(Objective otherObjective, float distance)
 {
     _distanceData.Add(otherObjective, distance);
 }
Exemple #3
0
 public float GetRangedDistanceTo(Objective otherObjective)
 {
     return GetMeleeDistanceTo(otherObjective) - RangedRange * 2f;
 }
Exemple #4
0
 public float GetMeleeDistanceTo(Objective otherObjective)
 {
     if (_distanceData.ContainsKey(otherObjective))
         return _distanceData[otherObjective];
     return otherObjective._distanceData.ContainsKey(this) ? otherObjective._distanceData[this] : Position.Distance(otherObjective.Position);
 }
 public void SetDistanceTo(Objective otherObjective, float distance)
 {
     _distanceData.Add(otherObjective, distance);
 }
 public float GetRangedDistanceTo(Objective otherObjective)
 {
     return(GetMeleeDistanceTo(otherObjective) - RangedRange * 2f);
 }