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; } }
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(); }
const GeoPoint& AATPoint::GetLocationRemaining() const { if (GetActiveState() != BEFORE_ACTIVE) return target_location; if (HasSampled()) return GetLocationMax(); return GetLocationMin(); }
bool AATPoint::CheckTarget(const AircraftState &state, const bool known_outside) { if (GetActiveState() == CURRENT_ACTIVE && target_locked) return false; bool moved = false; if (!known_outside && IsInSector(state)) moved = CheckTargetInside(state); else moved = CheckTargetOutside(state); return moved; }