Ejemplo n.º 1
0
 public void AttemptToSetNewClosestGravityField(Attractor potentialClosest, float distance)
 {
     if (_closest == null)
     {
         _closest = potentialClosest;
         _nearestSqrDistanceFound = distance;
         return;
     }
     if (distance < _nearestSqrDistanceFound)
     {
         _closest = potentialClosest;
         _nearestSqrDistanceFound = distance;
     }
 }
Ejemplo n.º 2
0
 public void RemoveGravityAction(Attractor gravityField)
 {
     _attractorApplyingForce.Remove(gravityField);
 }
Ejemplo n.º 3
0
 public void AddGravityAction(Attractor gravityField)
 {
     _attractorApplyingForce.AddIfNotContain(gravityField);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// return true if this GravityFieldAction is actually the closest one to the player
 /// </summary>
 public bool IsTheValidOneInTheGroup(Attractor toTest)
 {
     return(toTest == _closest);
 }
Ejemplo n.º 5
0
 public void ResetGroup()
 {
     _closest = null;
 }