Пример #1
0
bool
AATPoint::SetRange(const fixed p, const bool force_if_current)
{
  if (target_locked)
    return false;

  switch (GetActiveState()) {
  case BEFORE_ACTIVE:
    return false;

  case CURRENT_ACTIVE:
    if (!HasEntered() || force_if_current) {
      target_location = InterpolateLocationMinMax(p);
      return true;
    }
    return false;

  case AFTER_ACTIVE:
    target_location = InterpolateLocationMinMax(p);
    return true;
  }

  assert(false);
  gcc_unreachable();
}
Пример #2
0
bool
AATPoint::SetRange(const fixed p, const bool force_if_current)
{
  if (target_locked)
    return false;

  switch (GetActiveState()) {
  case CURRENT_ACTIVE:
    if (!HasEntered() || force_if_current) {
      target_location = GetLocationMin().Interpolate(GetLocationMax(),p);
      return true;
    }
    return false;

  case AFTER_ACTIVE:
    if (GetActiveState() == AFTER_ACTIVE) {
      target_location = GetLocationMin().Interpolate(GetLocationMax(),p);
      return true;
    }
    return false;

  default:
    return false;
  }
}
Пример #3
0
const GeoPoint &
ScoredTaskPoint::GetLocationScored() const
{
  if (IsBoundaryScored() || !HasEntered())
    return GetLocationMin();

  return GetLocation();
}
Пример #4
0
bool 
ScoredTaskPoint::TransitionEnter(const AircraftState &ref_now,
                                 const AircraftState &ref_last)
{
  if (!CheckEnterTransition(ref_now, ref_last))
    return false;

  if (EntryPrecondition() && (!ScoreFirstEntry() || !HasEntered()))
    state_entered = ref_now;

  return true;
}